Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\PropertyConditionGenerator::getValueForOperand PHP Method

getValueForOperand() public method

Returns the static value of the given operand, this might be also a global object
public getValueForOperand ( mixed $expression ) : mixed
$expression mixed The expression string representing the operand
return mixed The calculated value
    public function getValueForOperand($expression)
    {
        if (is_array($expression)) {
            $result = [];
            foreach ($expression as $expressionEntry) {
                $result[] = $this->getValueForOperand($expressionEntry);
            }
            return $result;
        } elseif (is_numeric($expression)) {
            return $expression;
        } elseif ($expression === true) {
            return true;
        } elseif ($expression === false) {
            return false;
        } elseif ($expression === null) {
            return null;
        } elseif (strpos($expression, 'context.') === 0) {
            $objectAccess = explode('.', $expression, 3);
            $globalObjectsRegisteredClassName = $this->globalObjects[$objectAccess[1]];
            $globalObject = $this->objectManager->get($globalObjectsRegisteredClassName);
            $this->securityContext->withoutAuthorizationChecks(function () use($globalObject, $objectAccess, &$globalObjectValue) {
                $globalObjectValue = $this->getObjectValueByPath($globalObject, $objectAccess[2]);
            });
            return $globalObjectValue;
        } else {
            return trim($expression, '"\'');
        }
    }