Пример #1
0
 private function buildObjectValue(ObjectType $type, $value)
 {
     $args = [];
     foreach ((array) $value as $item) {
         $args[] = $this->getDataValueFromValue($item);
     }
     return new ObjectValue($type->getClassName(), $args);
 }
Пример #2
0
 /**
  * ObjectValue constructor.
  *
  * @param FullyQualifiedClassName $className
  * @param DataValueInterface[]    $arguments
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(FullyQualifiedClassName $className, array $arguments = [])
 {
     foreach ($arguments as $argument) {
         if (false === $argument instanceof DataValueInterface) {
             throw new \InvalidArgumentException('Only DataValueInterface is allowed');
         }
     }
     $this->arguments = $arguments;
     parent::__construct($className);
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct(new FullyQualifiedClassName(\DateTime::class));
 }