コード例 #1
0
 protected function fill(AbstractObject $object, $data)
 {
     if (!is_object($data)) {
         throw new InternalErrorException("The `data` parameter must be an object.");
     }
     $values = get_object_vars($data) + $object->getValues();
     foreach ($values as $key => $value) {
         $typeMeta = $this->objectMetaService->getPropertyMeta($object->getObjectName(), $key, "Type");
         $object->set($key, $this->createFieldValue($typeMeta, $key, $value));
     }
     return $object;
 }
コード例 #2
0
 protected function fill(AbstractObject $object, $data)
 {
     // allows the object to handle the data itself; it'll use $this as fallback.
     $object->fill($data);
 }