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