/** * Delete all objects in the associated table * * This does NOT destroy relationships that have been created with other objects. * * @return ORM * @uses Module::event * @throws Gleez_Exception */ public function delete_all() { if ($this->_loaded) { throw new Gleez_Exception('Cannot delete all :model model because it is loaded.', array(':model' => $this->_object_name)); } Module::event($this->_object_name . '_pre_delete_all', $this); $this->_build(ORM::DELETE); $this->_db_builder->execute($this->_db); Module::event($this->_object_name . '_delete_all', $this); return $this->clear(); }
/** * Delete all objects in the associated table * * This does NOT destroy relationships that have been created with other objects. * * @param boolean $soft Make delete as soft or hard. Default hard * @return ORM * @uses Module::event * @throws Gleez_Exception */ public function delete_all($soft = FALSE) { if ($this->_loaded) { throw new Gleez_Exception('Cannot delete all :model model because it is loaded.', array(':model' => $this->_object_name)); } Module::event($this->_object_name . '_pre_delete_all', $this, $soft); if (is_array($this->_deleted_column) && $soft == TRUE) { } else { $this->_build(ORM::DELETE); $this->_db_builder->execute($this->_db); } Module::event($this->_object_name . '_delete_all', $this, $soft); return $this->clear(); }