public function updateAll($fields, $conditions)
    {
        return $this->query()->update()->where($conditions)->set($fields)->execute()->count();
    }
public function updateAll($fields, $conditions)
    {
        return $this->query()->update()->where($conditions)->set($fields)->execute()->count();
    }
public function updateAll ( $ fields , $ conditions ) { return $ this -> query ( ) -> update ( ) -> where ( $ conditions ) -> set ( $ fields ) -> execute ( ) -> count ( ) ; }
Update all matching records.

Sets the $fields to the provided values based on $conditions.
This method will *not* trigger beforeSave/afterSave events. If you need those
first load a collection of records and update them.

@param array $fields A hash of field => new value.
@param mixed $conditions Conditions to be used, accepts anything Query::where() can take.
@return int Count Returns the affected rows.
Update all matching records .