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