Example #1
0
 /**
  * @param LiteObject $object
  * @param array $data
  * @param IValuesProcessorContainer $container
  * @return LiteObject
  */
 private static function setFields(LiteObject $object, $data, IValuesProcessorContainer $container)
 {
     $className = get_class($object);
     if ($container->has($className)) {
         $data = $container->get($className)->toObjectValues($data);
     }
     if ($object instanceof IMappedObject) {
         $object->setObjectData($data);
     } else {
         $data = array_intersect_key($data, array_flip($object->getPropertyNames()));
         $object->fromArray($data);
     }
     return $object;
 }
Example #2
0
 /**
  * @param string $className
  * @return ValuesProcessorCreator
  */
 public function valuesOf($className)
 {
     $processor = $this->valuesProcessor->getOrCreate($className);
     return new ValuesProcessorCreator($processor);
 }