We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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.phalcon.io/en/latest/reference//models.html#deleting-records), but SELECT with condition and deleting each manually is not a very good idea for me.


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")