/** * @param EntityInterface $object * @param $attribute * @param $message * @param array $params */ protected function addError(EntityInterface $object, $attribute, $message, $params = []) { $params['{attribute}'] = $attribute; $object->addError($attribute, strtr($message, $params)); }
/** * Update entity document * @param EntityInterface $object * @return mixed */ protected function update(EntityInterface $object) { $params = $object->getAttributes(); $sql = (new Query())->update($this->dbClass)->where('@rid=?', $object->getRid())->set($params)->getRaw(); return $this->prepareClient()->command($sql); }