Ouzo\Db\Query::update PHP 메소드

update() 공개 정적인 메소드

public static update ( $attributes )
    public static function update($attributes)
    {
        return Query::newInstance(QueryType::$UPDATE)->attributes($attributes);
    }

Usage Example

예제 #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();
 }