Exemple #1
0
 /**
  * @param LiteObject|IMappedObject $object
  * @param IValuesProcessorContainer $container
  * @return array
  */
 private static function getFields(LiteObject $object, IValuesProcessorContainer $container)
 {
     if ($object instanceof IMappedObject) {
         $data = $object->getObjectData();
     } else {
         $data = $object->toArray();
     }
     $className = get_class($object);
     if ($container->has($className)) {
         $data = $container->get($className)->toRawValues($data);
     }
     return $data;
 }
 /**
  * @param LiteObject $object
  * @param array $keyFields
  * @return bool
  */
 public function updateObjectByFields(LiteObject $object, array $keyFields)
 {
     return (bool) $this->updateByFields($object->toArray([], $keyFields), $object->toArray($keyFields));
 }