private function buildObjectValue(ObjectType $type, $value) { $args = []; foreach ((array) $value as $item) { $args[] = $this->getDataValueFromValue($item); } return new ObjectValue($type->getClassName(), $args); }
/** * 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); }
public function __construct() { parent::__construct(new FullyQualifiedClassName(\DateTime::class)); }