TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
ORM::_build(Database::DELETE) in 3.2.0
  • Hi,

    This is related to the orm issue I reported here: http://dev.kohanaframework.org/issues/4177 . Basically I want to have a method in my models to delete_all(), without having to load the results and delete them one by one. Like $users->images->delete_all(); for example to build a query like

    DELETE FROM `images` WHERE `user_id` = 1;

    I am fine with something like Model_X extends Base_Model extends ORM where Base_Model has this delete_all() function:

    public function delete_all() {
        return $this->clear();

    My question is if there's any alternative to building the DB query without having ORM aliasing the table name (because DELETE FROM images as image throws a mysql error as explained in the issue).