Retrieves a property from the object and makes it visible

@param string $propertyName
@return \ReflectionProperty
507447
private function getAccessibleReflectionProperty($propertyName)
    {
        $property = $this->reflClass->getProperty($propertyName);
        $property->setAccessible(true);

        return $property;
    }
363733
public function isPropertyPrivate($className, $propertyName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return (isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_VISIBILITY])
            && $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_VISIBILITY] === self::VISIBILITY_PRIVATE);
    }
1195321
private static function triggerVisibilityError($className, $propertyName)
    {
        $existed = property_exists($className, $propertyName);
        if ($existed) {
            trigger_error(sprintf(
                'Cannot access %s property %s',
                (new \ReflectionProperty($className, $propertyName))->isPrivate() ? 'private' : 'protected',
                $className . '::' . $propertyName
            ), E_USER_ERROR);
        }
        return $existed;
    }
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);
    }
9811
public function getCleanStateOfProperty($object, $propertyName)
    {
        if ($this->isReconstitutedEntity($object) === false) {
            return null;
        }
        $identifier = $this->getIdentifierByObject($object);
        if (!isset($this->reconstitutedEntitiesData[$identifier]['properties'][$propertyName])) {
            return null;
        }
        return $this->reconstitutedEntitiesData[$identifier]['properties'][$propertyName];
    }
1368076
public function getProperty($propertyName)
    {
        if (isset($this->properties[$propertyName])) {
            return $this->properties[$propertyName];
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition) {
            if ($extendsClassDefinition->hasProperty($propertyName)) {
                return $extendsClassDefinition->getProperty($propertyName);
            }
        }

        return false;
    }
1045653
public function getProperty($propertyName)
    {
        if ('id' === $propertyName) {
            return $this->getID();
        }

        if (\array_key_exists($propertyName, $this->arrProperties)) {
            return $this->arrProperties[$propertyName];
        }

        return null;
    }
303402
public function getStaticPropertyValue($object, $propertyName) {
        $className = $object;

        if(is_object($className)) {
            $className = get_class($object);
        }

        $reflector = new ReflectionClass($className);
        $properties = $reflector->getStaticProperties();

        return (isset($properties[$propertyName])) ? $properties[$propertyName] : NULL;
    }
1354993
public static function getDbFieldName($propertyName)
    {
        if (!isset(self::$cachedDbFieldNames[$propertyName])) {
            self::$cachedDbFieldNames[$propertyName] = Str::camelToSeparator($propertyName);
        }

        return self::$cachedDbFieldNames[$propertyName];
    }
434234
protected function getProperty(\ReflectionClass $reflection, $propertyName): ReflectionProperty
    {
        $property = $reflection->getProperty($propertyName);
        $property->setAccessible(true);
        return $property;
    }
863103
protected function getUniqueId($propertyName)
    {
        $inputProvider  = $this->getEnvironment()->getInputProvider();
        $sessionStorage = $this->getEnvironment()->getSessionStorage();

        $selector = 'ctrl_' . $propertyName;

        if (('select' !== $inputProvider->getParameter('act'))
            || (false === $inputProvider->hasValue('edit') && false === $inputProvider->hasValue('edit_save'))
        ) {
            return $selector;
        }

        $modelId = ModelId::fromModel($this->model);
        $fields  = $sessionStorage->get($modelId->getDataProviderName() . '.edit')['properties'];

        $fieldId = new ModelId('property.' . $modelId->getDataProviderName(), $propertyName);
        if (!\in_array($fieldId->getSerialized(), $fields)) {
            return $selector;
        }

        $selector = 'ctrl_' . \str_replace('::', '____', $modelId->getSerialized()) . '_' . $propertyName;

        return $selector;
    }
567318
public function getByName($propertyName)
    {
        $foundList = new self();
        $list = $this->getIterator();
        foreach ($list as $property) {
            if ((is_array($propertyName) && in_array($property->getName(), $propertyName))
                || ($property->getName() === $propertyName)
            ) {
                $foundList->add($property);
            }
        }

        return $foundList;
    }
1330993
public function getPropertyAnnotations($className, $propertyName, $annotationClassName = null)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_ANNOTATIONS])) {
            return [];
        }

        if ($annotationClassName === null) {
            return $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_ANNOTATIONS];
        }

        if (isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_ANNOTATIONS][$annotationClassName])) {
            return $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_ANNOTATIONS][$annotationClassName];
        }

        return [];
    }
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;
        }
    }
443741
public static function getPropertyValue($object,$propertyName)
    {
        $getter = "get" . ucfirst($propertyName);
        if (method_exists($object, $getter)) {
            return $object->$getter();
        }
        return null;
    }
282466
private function isExistingPropertyGetterAvailable(string $propertyName): bool
    {
        assert($this->propertyExists($propertyName));
        if ($this->isExistingPropertyVirtual($propertyName)) {
            return !is_null($this->virtualGetters[$propertyName]);
        } else {
            return $this->realGetAvailable[$propertyName];
        }
    }
861341
public function getDefaultPropertyValue($className, $propertyName)
    {
        $reflection = new \ReflectionClass($className);
        $values = $reflection->getDefaultProperties();
        return $values[$propertyName] ?? null;
    }