/** * Injects (again) all properties, be it through setter injection or through * reflection. Arguments can - naturally - not be injected once the object * lives, because the constructor must not be called a second time. * * This method is used for reinjecting dependencies after an object has been * reconstituted or unserialized. * * @param object $object The object to inject properties into * @param \F3\FLOW3\Object\Configuration\Configuration $objectConfiguration The object configuration * @return void * @author Karsten Dambekalns <*****@*****.**> * @author Robert Lemke <*****@*****.**> */ public function reinjectDependencies($object, \F3\FLOW3\Object\Configuration\Configuration $objectConfiguration) { $properties = $objectConfiguration->getProperties(); $className = $objectConfiguration->getClassName(); if ($objectConfiguration->getAutowiring() === \F3\FLOW3\Object\Configuration\Configuration::AUTOWIRING_MODE_ON && $className !== NULL) { $properties = $this->autowireProperties($properties, $className); } $this->injectProperties($properties, $object); }
/** * Sets the object configuration for a specific object. * * @param \F3\FLOW3\Object\Configuration\Configuration $newObjectConfiguration The new object configuration * @return void * @author Robert Lemke <*****@*****.**> */ public function setObjectConfiguration(\F3\FLOW3\Object\Configuration\Configuration $newObjectConfiguration) { $objectName = $newObjectConfiguration->getObjectName(); if (isset($this->objectConfigurations[$objectName])) { $oldClassName = $this->objectConfigurations[$objectName]->getClassName(); unset($this->registeredClasses[$oldClassName]); } $this->registeredClasses[$newObjectConfiguration->getClassName()] = $objectName; $this->objectConfigurations[$objectName] = clone $newObjectConfiguration; $this->registeredObjects[$objectName] = strtolower($objectName); }