Fork me on GitHub

delete_all

To delete all records that match given conditions, use delete_all().

<?php

class Event extends MvcModel {
  
  public function delete_past_events() {
    $this->delete_all( array(
            'conditions' =>  array('date <' => date('Y-m-d')
                ))
    );
  }
  
}

?>