Login +

How To ? / Deleting recordset

Suppose the Model of the table article generated:

public function action()
{    
    // Object
    $this->_generic->useModel("Article");
    $article = new Main_Article();
       
    // Get recordset with pk 1
    if ($article->getModel(1))
    {
        // Delete this article
        $deleted = $article->delete();
    }
}