lithium\data\source\Database::update PHP Method

update() public method

Updates a record in the database based on the given Query.
public update ( object $query, array $options = [] ) : boolean
$query object A `lithium\data\model\Query` object
$options array none
return boolean
    public function update($query, array $options = array())
    {
        return $this->_filter(__METHOD__, compact('query', 'options'), function ($self, $params) {
            $query = $params['query'];
            $params = $query->export($self);
            $sql = $self->renderCommand('update', $params, $query);
            $result = (bool) $self->invokeMethod('_execute', array($sql));
            if ($result && is_object($query) && $query->entity()) {
                $query->entity()->sync();
            }
            return $result;
        });
    }