/** * @param Type\Collection\IdentifiedObject $objectType * @param object $object * @param array $values * * @return Deserialize */ private function processDeserializeTypeCollectionIdentifiedObject(Type\Collection\IdentifiedObject $objectType, $object, array $values) : self { $identifierAttribute = $this->configuration->getIdentifierAttribute(); $objects = []; foreach ($values as $key => $objectFromValue) { if (isset($objectFromValue[$identifierAttribute]) === false) { continue; } $configurationObject = $this->configuration->getConfigurationObjectForIdentifier($objectFromValue[$identifierAttribute]); if ($configurationObject instanceof Blackhole) { continue; } $objects[$key] = $this->setObjectForClass($configurationObject->getClassName(), $objectFromValue); } $object->{$objectType->setter()}($objects); return $this; }