|
[WORKING] mosDBTable->canDelete |
|
|
|
|
Last reviewed: Not reviewed
phpDocumentor
Checks whether it is safe to delete a record from the table by checking whether dependancies exist for this record in the database schema. It does this by performing a join between this table and the tables to be checked. If the join returns an empty result set then it should be safe to delete the record. This function may be overloaded/supplemented by the child class as required.
Syntax
boolean canDelete ( [ int $id [, array $joins ]] )
- $id
- is the primary key index for the record to be checked. This parameter is optional and if omitted will default to null.
- $joins
- is an array. This parameter is optional and if omitted will default to null. If this parameter
is present then each entry in the $joins array must contain the following items:
- label
- is a string that will be used to explain the dependency in an error message.
- name
- is the name of the table to be checked for a dependency by a join.
- idfield
- is the name of the primary key field in the table to be joined.
- joinfield
- is the name of the field in the joined table to be used in the join.
Examples
Please report any errors on this page to the Developer Documentation Forum.
|
|
Last Updated ( Monday, 25 December 2006 )
|