@param array $propertyRows
@param Property $property

@return array|string
359779
private static function fillForFrontend($propertyRows, $property)
    {
        $carry = '';
        $column = static::dataTypeToEavColumn($property->data_type);
        foreach ($propertyRows as $row) {
            $value = Property::castValueToDataType($row[$column], $property->data_type);
            if ($property->allow_multiple_values === false) {
                if (true === empty($carry)) {
                    $carry = $value;
                }
                continue;
            }
            $carry[] = $value;
        }
        return $carry;
    }
131424
public function propertyPath($data, $propertyPath)
    {
        if (null !== $propertyPath && !$propertyPath instanceof PropertyPathInterface) {
            $propertyPath = new PropertyPath($propertyPath);
        }

        if ($propertyPath instanceof PropertyPathInterface && (\is_object($data) || $data instanceof \ArrayAccess)) {
            $data = $this->propertyAccessor->getValue($data, $propertyPath);
        }

        return $data;
    }
200657
private function getPropertySettings($property)
    {
        $data = [];
        $settings = [
            'minimum' => 'min',
            'maximum' => 'max',
        ];
        foreach ($settings as $setting => $name) {
            if (isset($property[$setting])) {
                $data[] = $name.':'.$property[$setting];
            }
        }

        return implode(' | ', $data);
    }
1254383
function Get($key, $property) {
		$key = strtolower($key);
		$property = strtolower($property);

		list($tag, $subtag) = explode(':', $key);
		list($tag, $class) = explode('.', $tag);
		list($tag, $id) = explode('#', $tag);
		$result = '';
		foreach($this->css as $_tag => $value) {
			list($_tag, $_subtag) = explode(':', $_tag);
			list($_tag, $_class) = explode('.', $_tag);
			list($_tag, $_id) = explode('#', $_tag);

			$tagmatch = (strcmp($tag, $_tag) == 0) | (strlen($_tag) == 0);
			$subtagmatch = (strcmp($subtag, $_subtag) == 0) | (strlen($_subtag) == 0);
			$classmatch = (strcmp($class, $_class) == 0) | (strlen($_class) == 0);
			$idmatch = (strcmp($id, $_id) == 0);

			if($tagmatch & $subtagmatch & $classmatch & $idmatch) {
		    	$temp = $_tag;
				if((strlen($temp) > 0) & (strlen($_class) > 0)) {
					$temp .= '.' . $_class;
				} elseif(strlen($temp) == 0) {
					$temp = '.' . $_class;
				}
				if((strlen($temp) > 0) & (strlen($_subtag) > 0)) {
					$temp .= ':' . $_subtag;
				} elseif(strlen($temp) == 0) {
					$temp = ':' . $_subtag;
				}
				if(isset($this->css[$temp][$property])) {
					$result = $this->css[$temp][$property];
				}
			}
		}
		return $result;
	}
729005
protected static function createProperty(array $propertyValues)
    {
        return array_map(
            function($propertyValue) {
                if (is_array($propertyValue)) {
                    return isset($propertyValue['type']) ?
                        self::createItem($propertyValue) : self::tagLanguage($propertyValue);
                }

                return $propertyValue;
            },
            $propertyValues
        );
    }
193146
protected function getElementName(Property $property)
	{
		/* @var $annotations ElementNameAnnotation[] */
		$annotations = $property->getAnnotationsFromPropertyOrClass('@element-name');

		if ( $annotations && ($annotations[0] instanceof ElementNameAnnotation) ) {
			return $annotations[0]->name;
		}

		return (string)$property;
	}
809551
private function getValue(PropertyInterface $property)
    {
        $default = ['presentAs' => null, 'items' => []];
        if (!is_array($property->getValue())) {
            return $default;
        }

        return array_merge($default, $property->getValue());
    }
1027542
public function getValidationRules(Property $property)
    {
        $key = $property->key;
        if (true === $property->canTranslate()) {
            return [
                [$key, ValuesValidator::class, 'skipOnEmpty' => true],
            ];
        } else {
            if ($property->allow_multiple_values) {
                return [
                    [$key, 'each', 'rule' => ['safe']],
                ];
            } else {
                return [
                    [$key, 'safe'],
                ];
            }
        }
    }
1205204
public static function getValue($objectOrArray, $property)
    {
        $propertyValue = null;

        if (is_object($objectOrArray)) {

            $camelProp = str_replace(' ', '', ucwords(str_replace('_', ' ', $property)));
            $methods = array('get'.$camelProp, lcfirst($camelProp), 'is'.$camelProp, 'has'.$camelProp);

            foreach ($methods as $method) {
                if (method_exists($objectOrArray, $method)) {
                    $propertyValue = $objectOrArray->$method();
                    break;
                }
            }

            if (null === $propertyValue && property_exists($objectOrArray, $property)) {
                $propertyValue = $objectOrArray->$property;
            }
        } elseif (is_array($objectOrArray)) {
            if (isset($objectOrArray[$property])) {
                $propertyValue = $objectOrArray[$property];
            }
        }

        return $propertyValue;
    }
324907
private function propertySetList(array $property_injections)
    {
        $this->state->category = CompilerState::CATEGORY_PROPERTY;
        $ret = '';
        foreach($property_injections as $injection){
            $property_name = $injection['property'] ?? null;
            $value = $injection['value'] ?? null;
    
            $this->state->name = $property_name;
    
            if (is_null($value)){
                $value = 'null';
            }
            elseif (is_string($value)){
                $value = $this->decorateStringValue($value);
            }
            elseif (is_array($value)){
                $value = $this->decorateArrayValue($value);
            }
            
            $ret .= "        \$component->{$property_name} = {$value};\n";
        }
        return $ret;
    }
1029379
public function resolvePropertyTypeInfo(Property $property): ?VarTypeInfo
    {
        $types = [];

        $propertyDefault = $property->props[0]->default;
        if ($propertyDefault !== null) {
            $types[] = $this->nodeToStringTypeResolver->resolver($propertyDefault);
        }

        $classNode = $property->getAttribute(AttributeKey::CLASS_NODE);
        if (! $classNode instanceof Class_) {
            throw new ShouldNotHappenException();
        }

        $propertyName = $this->nameResolver->resolve($property);
        if ($propertyName === null) {
            return null;
        }

        /** @var Assign[] $propertyAssignNodes */
        $propertyAssignNodes = $this->betterNodeFinder->find([$classNode], function (Node $node) use (
            $propertyName
        ): bool {
            if ($node instanceof Assign && $node->var instanceof PropertyFetch) {
                // is property match
                return $this->nameResolver->isName($node->var, $propertyName);
            }

            return false;
        });

        foreach ($propertyAssignNodes as $propertyAssignNode) {
            $types = array_merge(
                $types,
                $this->nodeTypeResolver->resolveSingleTypeToStrings($propertyAssignNode->expr)
            );
        }

        $types = array_filter($types);

        return new VarTypeInfo($types, $this->typeAnalyzer, $types, true);
    }
141397
public function getProperties(array $resultColumns, Row $row) {
        $attributes = array();

        $columns = $this->query->columns;

        // What we get returned from the client is a result set
        // and each result is either a Node or a single column value
        // so we first extract the returned value and retrieve
        // the attributes according to the result type.
        // Only when requesting a single property
        // will we extract the current() row of result.

        $current = $row->current();

        $result = ($current instanceof Node) ? $current : $row;

        if ($this->isRelationship($resultColumns)) {
            // You must have chosen certain properties (columns) to be returned
            // which means that we should map the values to their corresponding keys.
            foreach ($resultColumns as $key => $property) {
                $value = $row[$property];

                if ($value instanceof Node) {
                    $value = $this->getNodeAttributes($value);
                } else {
                    // Our property should be extracted from the query columns
                    // instead of the result columns
                    $property = $columns[$key];

                    // as already assigned, RETURNed props will be preceded by an 'n.'
                    // representing the node we're targeting.
                    $returned = $this->query->modelAsNode() . ".{$property}";

                    $value = $row[$returned];
                }

                $attributes[$property] = $value;
            }

            // If the node id is in the columns we need to treat it differently
            // since Orientdb's convenience with node ids will be retrieved as id(n)
            // instead of n.id.
            // WARNING: Do this after setting all the attributes to avoid overriding it
            // with a null value or colliding it with something else, some Daenerys dragons maybe ?!
            if (!is_null($columns) && in_array('id', $columns)) {
                $attributes['id'] = $row['id(' . $this->query->modelAsNode() . ')'];
            }
        } elseif ($result instanceof Node) {
            $attributes = $this->getNodeAttributes($result);
        } elseif ($result instanceof Row) {
            $attributes = $this->getRowAttributes($result, $columns, $resultColumns);
        }

        return $attributes;
    }
1327689
public function flat(array $properties): string
    {
        Assert::isMap($properties);

        return $this->arrayImploder->byGlue($properties, ';', ':');
    }
121709
protected function getProperty($resource, $property)
    {
        if($property == '_self') {
            return $resource;
        }

        $propertyPath = explode('.', $property);

        if(count($propertyPath) > 1) {
            $property = array_shift($propertyPath);
            $newResource = $this->getProperty($resource, $property);
            if($newResource !== null) {
                $propertyPath = implode('.', $propertyPath);
                return $this->getProperty($newResource, $propertyPath);
            } else {
                return null;
            }
        } else {
            $method = sprintf('is%s', ucfirst($property));
            if(method_exists($resource, $method)) {
                return call_user_func(array($resource, $method));
            }

            $method = sprintf('get%s', ucfirst($property));
            if(method_exists($resource, $method)) {
                return call_user_func(array($resource, $method));
            }
        }

        throw new PropertyNotExistsException(sprintf(
            'Trying to call "get%s" or "is%s" on class "%s", but method does not exists. Maybe you spelled it wrong or you didn\'t add the getter for property "%s"',
            ucfirst($property),
            ucfirst($property),
            get_class($resource),
            $property
        ));
    }
690170
private function rowToArray(Row $row, $locale, $webspaceKey, $fields, $onlyPublished = true)
    {
        // reset cache
        $this->initializeExtensionCache();
        $templateName = $this->encoder->localizedSystemName('template', $locale);

        // check and determine shadow-nodes
        $node = $row->getNode('page');

        try {
            $document = $this->documentManager->find($node->getIdentifier(), $locale);
        } catch (StructureTypeNotFoundException $e) {
            return false;
        }

        $originalDocument = $document;

        if (!$node->hasProperty($templateName) && !$node->hasProperty('template')) {
            return false;
        }

        $redirectType = null;
        $url = null;
        if ($document instanceof RedirectTypeBehavior) {
            $redirectType = $document->getRedirectType();

            if (RedirectType::INTERNAL === $redirectType) {
                $target = $document->getRedirectTarget();

                if ($target) {
                    $url = $target->getResourceSegment();

                    $document = $target;
                    $node = $this->inspector->getNode($document);
                }
            }

            if (RedirectType::EXTERNAL === $redirectType) {
                $url = $document->getRedirectExternal();
            }
        }

        $originLocale = $locale;
        if ($document instanceof ShadowLocaleBehavior) {
            $locale = $document->isShadowLocaleEnabled() ? $document->getShadowLocale() : $originLocale;
        }

        $nodeState = null;
        if ($document instanceof WorkflowStageBehavior) {
            $nodeState = $document->getWorkflowStage();
        }

        // if page is not piblished ignore it
        if ($onlyPublished && WorkflowStage::PUBLISHED !== $nodeState) {
            return false;
        }

        if ($document instanceof ResourceSegmentBehavior && !isset($url)) {
            $url = $document->getResourceSegment();
        }

        // generate field data
        $fieldsData = $this->getFieldsData(
            $row,
            $node,
            $document,
            $fields[$originLocale],
            $document->getStructureType(),
            $webspaceKey,
            $locale
        );

        $structureType = $document->getStructureType();
        $shortPath = $this->inspector->getContentPath($originalDocument);

        $documentData = [
            'uuid' => $originalDocument->getUuid(),
            'nodeType' => $redirectType,
            'path' => $shortPath,
            'changed' => $document->getChanged(),
            'changer' => $document->getChanger(),
            'created' => $document->getCreated(),
            'publishedState' => WorkflowStage::PUBLISHED === $nodeState,
            'published' => $document->getPublished(),
            'creator' => $document->getCreator(),
            'title' => $originalDocument->getTitle(),
            'locale' => $locale,
            'webspaceKey' => $this->inspector->getWebspace($document),
            'template' => $structureType,
            'parent' => $this->inspector->getParent($document)->getUuid(),
        ];

        if (isset($url)) {
            $documentData['url'] = $url;
            $documentData['urls'] = $this->inspector->getLocalizedUrlsForPage($document);
        }

        if ($document instanceof LocalizedAuthorBehavior) {
            $documentData['author'] = $document->getAuthor();
            $documentData['authored'] = $document->getAuthored();
        }

        if ($document instanceof OrderBehavior) {
            $documentData['order'] = $document->getSuluOrder();
        }

        return array_merge($documentData, $fieldsData);
    }
234831
private function getKeyValueProperty($property)
    {
        $result = array();

        // extract key/value pairs
        $valuePairs = explode(',', $property);
        foreach ($valuePairs as $valuePair) {
            // extract key/value of a single value
            $keyValue = explode(':', $valuePair);

            // key and value must be present
            if (!isset($keyValue[1]) || !isset($keyValue[0])) {
                continue;
            }

            $key = trim($keyValue[0]);
            $value = trim($keyValue[1]);

            // key and value must be present
            if (!strlen($key) || !strlen($value)) {
                continue;
            }

            $result[$key] = $value;
        }

        return $result;
    }
389213
public function buildPropertiesString(array $properties)
    {
        $chunks = array();

        foreach ($properties as $property) {
            $chunks[] = $property->toString();
        }

        return implode(' ', $chunks);
    }