Get the type of a property

@param string $propertyName

@throws \InvalidArgumentException

@return string
347210
public function getPropertyType(string $propertyName) : string
    {
        $stringProperties = [
            'Comment' => 1,
            'Browser' => 1,
            'Browser_Maker' => 1,
            'Browser_Modus' => 1,
            'Browser_Type' => 1,
            'Platform' => 1,
            'Platform_Name' => 1,
            'Platform_Description' => 1,
            'Device_Name' => 1,
            'Platform_Maker' => 1,
            'Device_Code_Name' => 1,
            'Device_Maker' => 1,
            'Device_Brand_Name' => 1,
            'Device_Type' => 1,
            'RenderingEngine_Name' => 1,
            'RenderingEngine_Description' => 1,
            'RenderingEngine_Maker' => 1,
            'Parent' => 1,
            'PropertyName' => 1,
            'PatternId' => 1,
        ];

        if (isset($stringProperties[$propertyName])) {
            return self::TYPE_STRING;
        }

        $arrayProperties = [
            'Device_Pointing_Method' => 1,
            'Browser_Bits' => 1,
            'Platform_Bits' => 1,
        ];

        if (isset($arrayProperties[$propertyName])) {
            return self::TYPE_IN_ARRAY;
        }

        $genericProperties = [
            'Platform_Version' => 1,
            'RenderingEngine_Version' => 1,
        ];

        if (isset($genericProperties[$propertyName])) {
            return self::TYPE_GENERIC;
        }

        $numericProperties = [
            'Version' => 1,
            'CssVersion' => 1,
            'AolVersion' => 1,
            'MajorVer' => 1,
            'MinorVer' => 1,
        ];

        if (isset($numericProperties[$propertyName])) {
            return self::TYPE_NUMBER;
        }

        $booleanProperties = [
            'Alpha' => 1,
            'Beta' => 1,
            'Win16' => 1,
            'Win32' => 1,
            'Win64' => 1,
            'Frames' => 1,
            'IFrames' => 1,
            'Tables' => 1,
            'Cookies' => 1,
            'BackgroundSounds' => 1,
            'JavaScript' => 1,
            'VBScript' => 1,
            'JavaApplets' => 1,
            'ActiveXControls' => 1,
            'isMobileDevice' => 1,
            'isTablet' => 1,
            'isSyndicationReader' => 1,
            'Crawler' => 1,
            'MasterParent' => 1,
            'LiteMode' => 1,
            'isFake' => 1,
            'isAnonymized' => 1,
            'isModified' => 1,
        ];

        if (isset($booleanProperties[$propertyName])) {
            return self::TYPE_BOOLEAN;
        }

        throw new \InvalidArgumentException("Property {$propertyName} did not have a defined property type");
    }
762493
public function getChangeFor($propertyName)
    {
        foreach ($this->getIterator() as $change) {
            /* @var \Isolate\UnitOfWork\Entity\Value\Change\ScalarChange $change */
            if ($change->isFor($propertyName)) {
                return $change;
            }
        }

        throw new RuntimeException(sprintf("There are no changes for \"%s\" property.", $propertyName));
    }
64481
public function setCustomProperty($propertyName,$propertyValue='',$propertyType=NULL) {
        if (($propertyType === NULL) || (!in_array($propertyType,array(self::PROPERTY_TYPE_INTEGER,
                                                                       self::PROPERTY_TYPE_FLOAT,
                                                                       self::PROPERTY_TYPE_STRING,
                                                                       self::PROPERTY_TYPE_DATE,
                                                                       self::PROPERTY_TYPE_BOOLEAN)))) {
            if ($propertyValue === NULL) {
                $propertyType = self::PROPERTY_TYPE_STRING;
            } elseif (is_float($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_FLOAT;
            } elseif(is_int($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_INTEGER;
            } elseif (is_bool($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
            } else {
                $propertyType = self::PROPERTY_TYPE_STRING;
            }
        }

        $this->_customProperties[$propertyName] = array('value' => $propertyValue, 'type' => $propertyType);
        return $this;
    }
630971
public function getClassNameForPropertyName($propertyName)
    {
        $className = parent::getClassNameForPropertyName($propertyName);

        // In vCard 4, BINARY no longer exists, and we need URI instead.
        if ('Sabre\\VObject\\Property\\Binary' == $className && self::VCARD40 === $this->getDocumentType()) {
            return 'Sabre\\VObject\\Property\\Uri';
        }

        return $className;
    }
568607
final public function getPropertyType($name) {

		if (in_array($name, ['db', 'loadedFromDb', 'typeList', 'errors'])) {
			$type = NULL;
		} else if (array_key_exists($name, $this->typeList)) {
			$type = $this->typeList[$name];
		} else {
			$type = 'string';
		}

		return $type;
	
	}
407977
public function hasProperty( $propertyName ) {
			
			if ( self::isProperty( $propertyName ) ) {
			
				return array_key_exists( $propertyName, $this->properties );
			
			} else {
			
				return false;
			
			}
		}
784947
private function findOriginalPropertyByModelId($propertyName)
    {
        if (null === $propertyName) {
            return null;
        }

        $inputProvider  = $this->getEnvironment()->getInputProvider();
        $sessionStorage = $this->getEnvironment()->getSessionStorage();

        $selectAction = $inputProvider->getParameter('select');

        $session = $sessionStorage->get($this->getEnvironment()->getDataDefinition()->getName() . '.' . $selectAction);

        $originalPropertyName = null;
        foreach ($session['models'] as $modelId) {
            if (null !== $originalPropertyName) {
                break;
            }

            $propertyNamePrefix = \str_replace('::', '____', $modelId) . '_';
            if (0 !== strpos($propertyName, $propertyNamePrefix)) {
                continue;
            }

            $originalPropertyName = \substr($propertyName, \strlen($propertyNamePrefix));
        }

        $propertiesDefinition = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition();
        if (!$propertiesDefinition->hasProperty($originalPropertyName)) {
            return null;
        }

        return $propertiesDefinition->getProperty($originalPropertyName);
    }
1264912
public function getProperty($propertyName)
    {
        foreach ($this->getLegends() as $legend) {
            if ($legend->hasProperty($propertyName)) {
                return $legend->getProperty($propertyName);
            }
        }

        throw new DcGeneralRuntimeException(
            \sprintf(
                'The palette %s does not contain a property named %s',
                $this->getName(),
                $propertyName
            )
        );
    }
1010681
public static function getValue($object, $propertyName)
    {
        try {
            return MutatorProvider::getValue($object, $propertyName);
        } catch (\InvalidArgumentException $e) {
            return PropertyProvider::getValue($object, $propertyName);
        }
    }
125938
protected function getPropertyValue(array $properties, $propertyName)
    {
        if (!isset($properties[$propertyName])) {
            return null;
        }
        $value = reset($properties[$propertyName]);
        return $value instanceof \core_kernel_classes_Resource ? $value->getUri() : (string) $value;
    }
952038
private function getPropertyType($propertyValue)
    {
        if ($propertyValue instanceof \DateTime) {
            return EdmType::DATETIME;
        } elseif (is_float($propertyValue)) {
            return EdmType::DOUBLE;
        } elseif (is_int($propertyValue)) {
            return EdmType::INT32;
        } elseif (is_bool($propertyValue)) {
            return EdmType::BOOLEAN;
        }

        return EdmType::STRING;
    }
79460
public function getProperty($source, $propertyName) {
        foreach ($this->getPropertyAccessors() as $accessor) {
            if ($accessor->supports($source, $propertyName)) {
                return $accessor->getProperty($source, $propertyName);
            }
        }

        return null;
    }
545202
public function getProperty($propertyName)
    {
        foreach ($this->properties as $property) {
            if ($propertyName === $property->getName()) {
                return $property;
            }
        }

        throw new DcGeneralRuntimeException(
            \sprintf(
                'The legend %s does not contain a property named %s',
                $this->getName(),
                $propertyName
            )
        );
    }
346367
public function getTypeOfAttribute($attributeName)
    {
        return isset($this->propertyMetadata[$attributeName]) ?
            $this->propertyMetadata[$attributeName]->type : null;
    }
241163
public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration)
    {
        $configuredTargetType = $configuration->getConfigurationFor($propertyName)->getConfigurationValue(\Neos\Flow\Property\TypeConverter\PersistentObjectConverter::class, self::CONFIGURATION_TARGET_TYPE);
        if ($configuredTargetType !== null) {
            return $configuredTargetType;
        }

        $schema = $this->reflectionService->getClassSchema($targetType);
        $setterMethodName = ObjectAccess::buildSetterMethodName($propertyName);
        $constructorParameters = $this->reflectionService->getMethodParameters($targetType, '__construct');

        if (isset($constructorParameters[$propertyName]) && isset($constructorParameters[$propertyName]['type'])) {
            return $constructorParameters[$propertyName]['type'];
        } elseif ($schema->hasProperty($propertyName)) {
            $propertyInformation = $schema->getProperty($propertyName);
            return $propertyInformation['type'] . ($propertyInformation['elementType'] !== null ? '<' . $propertyInformation['elementType'] . '>' : '');
        } elseif ($this->reflectionService->hasMethod($targetType, $setterMethodName)) {
            $methodParameters = $this->reflectionService->getMethodParameters($targetType, $setterMethodName);
            $methodParameter = current($methodParameters);
            if (!isset($methodParameter['type'])) {
                throw new InvalidTargetException('Setter for property "' . $propertyName . '" had no type hint or documentation in target object of type "' . $targetType . '".', 1303379158);
            } else {
                return $methodParameter['type'];
            }
        } else {
            throw new InvalidTargetException('Property "' . $propertyName . '" was not found in target object of type "' . $targetType . '".', 1297978366);
        }
    }
1374534
public function getProperty($name)
    {
        $propertiesNames = [
            "divisibility"  => 0,
            "initialSupply" => 1,
            "supplyMutable" => 2,
            "transferable"  => 3,
        ];

        if (! array_key_exists($name, $propertiesNames)) {
            throw new InvalidArgumentException("Mosaic property name '" . $name ."' is invalid. Must be one of 'divisibility', "
                                             . "'initialSupply', 'supplyMutable' or 'transferable'.");
        }

        // sort properties lexicographically (see toDTO() overload)
        $sorted = $this->sortBy("name");
        $index = $propertiesNames[$name];
        $prop  = $sorted->get($index);

        if ($prop instanceof MosaicProperty) {
            return $prop->value;
        }

        return $prop["value"];
    }
79466
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
    {
        if (($propertyType === null) || (!in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER,
                                                                        self::PROPERTY_TYPE_FLOAT,
                                                                        self::PROPERTY_TYPE_STRING,
                                                                        self::PROPERTY_TYPE_DATE,
                                                                        self::PROPERTY_TYPE_BOOLEAN)))) {
            if ($propertyValue === null) {
                $propertyType = self::PROPERTY_TYPE_STRING;
            } elseif (is_float($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_FLOAT;
            } elseif (is_int($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_INTEGER;
            } elseif (is_bool($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
            } else {
                $propertyType = self::PROPERTY_TYPE_STRING;
            }
        }

        $this->customProperties[$propertyName] = array(
            'value' => $propertyValue,
            'type' => $propertyType
        );
        return $this;
    }