/** * @param ClassName $className * * @return ObjectInterface */ public function getConfigurationObjectForClass(ClassName $className) : ObjectInterface { if (isset($this->objects[$className->getIdentifier()]) === true) { return $this->objects[$className->getIdentifier()]; } return new Blackhole(); }
/** * Create $className object with data * * @param ClassName $className * @param mixed[] $data * * @return object|object[] */ private function setObjectForClass(ClassName $className, array $data) { $fqdnClass = $className->getValue(); $object = new $fqdnClass(); foreach ($data as $attribute => $value) { $configurationObject = $this->configuration->getConfigurationObjectForClass($className); $type = $configurationObject->getTypeForAttribute($attribute); $this->processDeserializeForType($type, $object, $value); } return $object; }