Jump to main content Jump to doc navigation

xPDOObject::remove()

Remove the persistent instance of an object permanently. This deletes rows from the database.

Syntax

API Docs: http://api.modxcms.com/xpdo/om/xPDOObject.html#remove

boolean remove ([array $ancestors = array ()])

Examples

Get rid of an item.

$item = $xpdo->getObject('Item',123);

if ($item->remove() == false) echo 'The Item failed to remove.';

See Also