Exemplo n.º 1
0
 protected function raiseError($message, Dao $dao = null)
 {
     $this->set('error_message', $message);
     if ($dao && $dao->inTransaction()) {
         $dao->rollBack();
     }
     return false;
 }
 public function __construct($message, Dao $dao = null, $sql = null)
 {
     if (!empty($dao)) {
         if ($dao->isDebug()) {
             $message .= sprintf("\nSQL: %s", $sql);
         }
     }
     parent::__construct($message, $dao);
 }
Exemplo n.º 3
0
 protected function executeDao(Dao $dao)
 {
     $values = array();
     //first update value
     foreach ($this->_update_fields as $value) {
         $values[] = $value;
     }
     foreach ($this->_increament_fields as $field_name => $options) {
         $values[] = $options['value'];
     }
     //then where
     $values = array_merge($values, $this->getWhereValues());
     return $dao->execute($values);
 }
Exemplo n.º 4
0
 protected function prepare(Dao $dao)
 {
     $sql = $this->buildStatement();
     Logger::getInstance('DBAL')->addInfo("prepared sql:{$sql}");
     return $dao->prepare($sql);
 }
Exemplo n.º 5
0
 protected function executeDao(Dao $dao)
 {
     $values = $this->getWhereValues();
     return $dao->execute($values);
 }
Exemplo n.º 6
0
 protected function setFetchMode(Dao $dao)
 {
     if (!isset($this->_datarow_class_name)) {
         $this->_datarow_class_name = '\\ORC\\DAO\\Table\\DataRow';
     }
     return $dao->setFetchMode(DAO::FETCH_CLASS | DAO::FETCH_PROPS_LATE, $this->_datarow_class_name);
 }