Delete many records from table

Can I produce query like ┬źDELETE FROM table WHERE condition┬╗ by \Phalcon\Model class? Similar example presented in documentation (http://docs.phalconphp.com/en/latest/reference//models.html#deleting-records), but SELECT with condition and deleting each manually is not a very good idea for me.



81.8k

No, Phalcon\Mvc\Model does not implement a table data gateway pattern, you can use the Db component to send a direct delete to the database:

$this->db->delete("robots", "id > 100")