protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath)
    {
        if (is_object($object)) {
            ObjectAccess::setProperty($object, $propertyName, $domainObject);
        } elseif (is_array($object)) {
            $this->injectDomainObjectInLastObject($domainObject, $lastObject, $objectArrayPropertyPath);
        }
    }
protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath)
    {
        if (is_object($object)) {
            ObjectAccess::setProperty($object, $propertyName, $domainObject);
        } elseif (is_array($object)) {
            $this->injectDomainObjectInLastObject($domainObject, $lastObject, $objectArrayPropertyPath);
        }
    }
protected function setDomainObjectInProperty ( $ object , $ propertyName , $ domainObject , $ lastObject , array $ objectArrayPropertyPath ) { if ( is_object ( $ object ) ) { ObjectAccess :: setProperty ( $ object , $ propertyName , $ domainObject ) ; } elseif ( is_array ( $ object ) ) { $ this -> injectDomainObjectInLastObject ( $ domainObject , $ lastObject , $ objectArrayPropertyPath ) ; } }
Will inject the domain object in the property, at the correct path.

@param object|array $object
@param string       $propertyName
@param object       $domainObject
@param object       $lastObject
@param array        $objectArrayPropertyPath
Will inject the domain object in the property at the correct path .