Пример #1
0
 /**
  * @param Type\IdentifiedObject $objectType
  * @param object $object
  * @param mixed $value
  *
  * @return Deserialize
  */
 private function processDeserializeTypeIdentifiedObject(Type\IdentifiedObject $objectType, $object, $value) : self
 {
     $identifierAttribute = $this->configuration->getIdentifierAttribute();
     if (isset($value[$identifierAttribute]) === false) {
         return $this;
     }
     $configurationObject = $this->configuration->getConfigurationObjectForIdentifier($value[$identifierAttribute]);
     if ($configurationObject instanceof Blackhole) {
         return $this;
     }
     $object->{$objectType->setter()}($this->setObjectForClass($configurationObject->getClassName(), $value));
     return $this;
 }
Пример #2
0
 /**
  * @param Type\IdentifiedObject $objectType
  * @param object $object
  * @param mixed[] $data
  * @param string $attribute
  *
  * @return mixed[]
  */
 private function processSerializeTypeIdentifiedObject(Type\IdentifiedObject $objectType, $object, array $data, string $attribute) : array
 {
     return $this->setArrayAndCheckNull($data, $object->{$objectType->getter()}(), $attribute);
 }