update() public static method

public static update ( $attributes )
示例#1
0
文件: Model.php 项目: letsdrink/ouzo
 public function update()
 {
     $this->_callBeforeSaveCallbacks();
     $attributes = $this->getAttributesForUpdate();
     if ($attributes) {
         $query = Query::update($attributes)->table($this->_modelDefinition->table)->where(array($this->_modelDefinition->primaryKey => $this->getId()));
         QueryExecutor::prepare($this->_modelDefinition->db, $query)->execute();
     }
     $this->_callAfterSaveCallbacks();
 }