Exemplo n.º 1
0
 /**
  * @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));
 }
Exemplo n.º 2
0
 /**
  * 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);
 }