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
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $id | mixed | Erasing target Primary ID |
Example
Controller
$model = new Model(true, array(
'table' => 'cms_news',
'id' => 'news_id',
'visible' => 'visible',
));
$erased = $model->erase(1);
// -> 1