Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 8 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow [WORKING] mosDBTable->delete

[WORKING] mosDBTable->delete PDF Print E-mail

Last reviewed: Not reviewed


Generic delete function. This method may be overridden/supplemented by the child class as required.

Note that the default method provided by mosDBTable does not check for dependancies so if your database structure is such that orphaned records are possible then you should consider calling mosDBTable->canDelete before this method or overriding this method with code that includes a call to mosDBTable->canDelete or equivalent functionality.


string delete ( [ int $id ] )

is the primary key index for the record to be deleted. This parameter is optional and if omitted will default to null.


Example: This example uses the myTable class defined on the mosDBTable class overview page.

global $database;
// Declare an instance of the myTable class.
$row = new myTable( $database );
// Delete the record with primary key $id.
if (!$row->delete( $id )) {
  mosErrorAlert( $row->getError());

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
< Prev   Next >