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
485711
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);
        }
    }
775696
public function allUniqueIn(IObjectSet $objects, string $propertyName)
    {
        $this->customProcessorCallbacks[] = function (IType $currentType, IFieldType $fieldType, $initialValue) use ($objects, $propertyName) {
            return new AllUniquePropertyValidator($currentType, $objects, $propertyName, $initialValue);
        };

        return $this;
    }
1001154
private static function addToResultArray(
        string $propertyName,
        $propertyValue,
        array $propertyNameMapper,
        array $resultArray
    ) {
        $mappedName = $propertyNameMapper[$propertyName]['name'] ?? $propertyNameMapper[$propertyName] ?? $propertyName;

        $resultArray[$mappedName] = self::isNestedData($propertyValue)
            ? self::toArray($propertyValue, $propertyNameMapper[$propertyName]['mapper'] ?? [])
            : $propertyValue;

        return $resultArray;
    }
1027660
private function cutOutCurrentAccessPropertyName(PropertyPath $propertyName, string $accessPropertyName) : PropertyPath
    {
        return PropertyPath::createWith(substr($propertyName->getPath(), strlen($accessPropertyName), strlen($propertyName->getPath())));
    }
425478
protected function getPropertyValue($object, string $propertyName, $default = null)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException('The first argument should be an object');
        }

        if (!property_exists($object, $propertyName)) {
            return $default;
        }

        try {
            $reflectionProperty = new ReflectionProperty($object, $propertyName);
            $reflectionProperty->setAccessible(true);

            return $reflectionProperty->getValue($object);
        } catch (ReflectionException $e) {
            return $default;
        }
    }
1365631
public function fromProperty(string $propertyName)
    {
        $classType = $this->classType;
        /** @var FinalizedClassDefinition $definition */
        $definition = $classType::definition();
        if (!$definition->hasProperty($propertyName)) {
            throw InvalidArgumentException::format(
                    'Invalid call to %s: property %s::$%s does not exist',
                    __METHOD__, $this->classType, $propertyName
            );
        }

        $this->fromCallback(function (ITypedObject $object) use ($propertyName) {
            return $object->toArray()[$propertyName];
        });
    }
303031
public function thawProperties($object, $identifier, array $objectData)
    {
        $classSchema = $this->reflectionService->getClassSchema($objectData['classname']);

        foreach ($objectData['properties'] as $propertyName => $propertyData) {
            if (!$classSchema->hasProperty($propertyName) ||
                $classSchema->isPropertyTransient($propertyName)) {
                continue;
            }
            $propertyValue = null;

            if ($propertyData['value'] !== null) {
                switch ($propertyData['type']) {
                    case 'integer':
                        $propertyValue = (int) $propertyData['value'];
                    break;
                    case 'float':
                        $propertyValue = (float) $propertyData['value'];
                    break;
                    case 'boolean':
                        $propertyValue = (boolean) $propertyData['value'];
                    break;
                    case 'string':
                        $propertyValue = (string) $propertyData['value'];
                    break;
                    case 'array':
                        $propertyValue = $this->mapArray($propertyData['value']);
                    break;
                    case 'Doctrine\Common\Collections\Collection':
                    case 'Doctrine\Common\Collections\ArrayCollection':
                        $propertyValue = new ArrayCollection($this->mapArray($propertyData['value']));
                    break;
                    case 'SplObjectStorage':
                        $propertyValue = $this->mapSplObjectStorage($propertyData['value'], $classSchema->isPropertyLazy($propertyName));
                    break;
                    case 'DateTime':
                        $propertyValue = $this->mapDateTime($propertyData['value']);
                    break;
                    default:
                        if ($propertyData['value'] === false) {
                            throw new UnknownObjectException('An expected object was not found by the backend. It was expected for ' . $objectData['classname'] . '::' . $propertyName, 1289509867);
                        }
                        $propertyValue = $this->mapToObject($propertyData['value']);
                    break;
                }
            } else {
                switch ($propertyData['type']) {
                    case 'NULL':
                        break;
                    case 'array':
                        $propertyValue = $this->mapArray(null);
                    break;
                    case Collection::class:
                    case ArrayCollection::class:
                        $propertyValue = new ArrayCollection();
                    break;
                    case 'SplObjectStorage':
                        $propertyValue = $this->mapSplObjectStorage(null);
                    break;
                }
            }

            ObjectAccess::setProperty($object, $propertyName, $propertyValue, true);
        }

        if (isset($objectData['metadata'])) {
            $object->Flow_Persistence_Metadata = $objectData['metadata'];
        }

        ObjectAccess::setProperty($object, 'Persistence_Object_Identifier', $identifier, true);
    }
590625
public static function getValue($object, $propertyName)
    {
        $metadata = self::$entityManager->getClassMetadata(get_class($object));

        if (!$metadata->hasField($propertyName)) {
            throw new \InvalidArgumentException(
                'The class "' . get_class($object) . '" does not have the property "' . $propertyName . '"'
            );
        }

        return $metadata->getFieldValue($object, $propertyName);
    }
91757
public function setProperty($propertyName, $propertyValue)
    {
        if ($propertyName == '')
            throw new Exception('Property Name not specified');

        if ($propertyValue == '')
            throw new Exception('Property Value not specified');

        //build URI 
        $strURI = Product::$baseProductUri . '/email/' . $this->getFileName() . '/properties/' . $propertyName;

        $put_data_arr['Value'] = $propertyValue;

        $put_data = json_encode($put_data_arr);

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'PUT', 'json', $put_data);

        $json = json_decode($responseStream);

        if ($json->Code == 200)
            return $json->EmailProperty->Value;
        else
            return false;
    }
387714
public static function collect(
        string $className,
        $objectAnnotation = null,
        string $propertyName = '',
        string $methodName = '',
        $propertyValue = null
    ) {
        if ($objectAnnotation instanceof Strings) {
            self::collectString($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Floats) {
            self::collectFloats($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Number) {
            self::collectNumber($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Integer) {
            self::collectInteger($objectAnnotation, $className, $methodName);
        } elseif ($objectAnnotation instanceof Enum) {
            self::collectEnum($objectAnnotation, $className, $methodName);
        }
    }
817285
public static function fromDomainObject($domainObject)
    {
        if (!is_object($domainObject)) {
            throw new InvalidDomainObjectException('$domainObject must be an object.');
        }

        try {
            if ($domainObject instanceof DomainObjectInterface) {
                return new self($domainObject->getObjectIdentifier(), ClassUtils::getRealClass($domainObject));
            } elseif (method_exists($domainObject, 'getId')) {
                return new self((string) $domainObject->getId(), ClassUtils::getRealClass($domainObject));
            }
        } catch (\InvalidArgumentException $e) {
            throw new InvalidDomainObjectException($e->getMessage(), 0, $e);
        }

        throw new InvalidDomainObjectException('$domainObject must either implement the DomainObjectInterface, or have a method named "getId".');
    }
836977
public static function getValue($object, $propertyName)
    {


        if (property_exists($object, $propertyName) || isset($object->$propertyName)) {
            try {
                return $object->$propertyName;
                // @codingStandardsIgnoreLine
            } catch (\BadFunctionCallException $e) {
                //Do nothing and continue
                // @codingStandardsIgnoreLine
            } catch (\InvalidArgumentException $e) {
                //Do nothing and continue
            }
        }


        throw new \InvalidArgumentException(
            vsprintf('The class "%s" does not have the property "%s" or it\'s not readable', array(
                get_class($object),
                $propertyName
            ))
        );
    }
532958
public static function setPropertyValue($object,$propertyName,$value)
    {
        $setter = "set" . ucfirst($propertyName);
        if (method_exists($object, $setter)) {
            $object->$setter($value);
        }
    }
426925
protected function getPropertyPath($element, $propertyPath)
    {
        if ($propertyPath[0] === '_') {
            return ObjectAccess::getPropertyPath($element, substr($propertyPath, 1));
        } else {
            return $element->getProperty($propertyPath);
        }
    }
601201
public static function isPropertyClassArray($class, $propertyName)
    {
        // If the class doesn't exist, or the method doesn't exist, return null.
        if (!class_exists($class) || !method_exists($class, self::getter($class, $propertyName))) {
            return null;
        }

        if (($annotations = self::propertyAnnotations($class, $propertyName)) && isset($annotations['return'])) {
            $param = $annotations['return'];
        }

        if (isset($param)) {
            return substr($param, -strlen('[]')) === '[]';
        } else {
            throw new BlockCypherConfigurationException("Getter function for '$propertyName' in '$class' class should have a proper return type.");
        }
    }
1010681
public static function getValue($object, $propertyName)
    {
        try {
            return MutatorProvider::getValue($object, $propertyName);
        } catch (\InvalidArgumentException $e) {
            return PropertyProvider::getValue($object, $propertyName);
        }
    }
542475
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Bootstrap) {

            $name = $objectAnnotation->getName();
            $order = $objectAnnotation->getOrder();

            self::$bootstraps[$className]['name'] = $name;
            self::$bootstraps[$className]['order'] = $order;
        }
    }