/** * @return \ORC\DAO\Table\DataList */ public function execute() { Callback::get('dbal.select.pre_execute')->call($this); Observer::getObserver('dbal.select.pre_execute')->notify(); $dao = $this->getDao(); if ($this->_has_empty_in) { $data = array(); $this->_total_count = 0; //no values found } else { $this->prepare($dao); $this->executeDao($dao); $this->setFetchMode($dao); $data = $dao->fetchAll(null); if (!empty($this->_limit)) { $this->_total_count = null; } else { $this->_total_count = count($data); } } $data = new \ORC\DAO\Table\DataList($data, $this->_table); Callback::get('dbal.select.post_execute')->call($this, $dao, $data); Observer::getObserver('dbal.select.post_execute')->notify(); return $data; }
/** * * @return bool */ public function execute() { Callback::get('dbal.update.pre_execute')->call($this); $dao = $this->getDao(); if ($this->_has_empty_in) { $result = false; } else { $this->prepare($dao); $result = $this->executeDao($dao); } Callback::get('dbal.update.post_execute')->call($this, $dao, $result); return $result; }
/** * * @return number */ public function execute() { Callback::get('dbal.delete.pre_execute')->call($this); Observer::getObserver('dbal.delete.pre_execute')->notify(); if ($this->_has_empty_in) { $count = 0; } else { $dao = $this->getDao(); $this->prepare($dao); $this->executeDao($dao); $count = $dao->rowCount(); } Callback::get('dbal.delete.post_execute')->call($this, $dao, $count); Observer::getObserver('dbal.delete.post_execute')->notify(); return $count; }