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