Skip to main content
Version: Fegg 5.x (next)

Model::erase

Execute Physical Delete the record by specified primary ID

Description​

public int Model::erase( mixed $id )

Removes the row whose primary key is $id from the table (DELETE) and returns the number of deleted rows. For a soft delete, use delete.

Arguments​

NameData typeDefaultRemarks
$idmixedErasing target Primary ID

Example​

Controller
$model = new Model(true, array(
'table' => 'cms_news',
'id' => 'news_id',
'visible' => 'visible',
));

$erased = $model->erase(1);
// -> 1