protected function buildGlobalRuntimeEvaluationsConditionCode(array $conditions, &$useGlobalObjects = false)
    {
        $evaluateConditionsCode = '';

        $isFirst = true;
        foreach ($conditions as $constraint) {
            $leftValue = $this->buildArgumentEvaluationAccessCode($constraint['leftValue'], $useGlobalObjects);
            $rightValue = $this->buildArgumentEvaluationAccessCode($constraint['rightValue'], $useGlobalObjects);

            if ($constraint['operator'] === 'in') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(' . $rightValue . ' instanceof \SplObjectStorage || ' . $rightValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $leftValue . ' !== NULL && ' . $rightValue . '->contains(' . $leftValue  . ') : in_array(' . $leftValue . ', ' . $rightValue . '))';
            } elseif ($constraint['operator'] === 'contains') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(' . $leftValue . ' instanceof \SplObjectStorage || ' . $leftValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $rightValue . ' !== NULL && ' . $leftValue . '->contains(' . $rightValue  . ') : in_array(' . $rightValue . ', ' . $leftValue . '))';
            } elseif ($constraint['operator'] === 'matches') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(!empty(array_intersect(' . $leftValue . ', ' . $rightValue . ')))';
            } else {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . $leftValue . ' ' . $constraint['operator'] . ' ' . $rightValue;
            }

            $isFirst = false;
        }

        return $evaluateConditionsCode . ')';
    }
protected function buildGlobalRuntimeEvaluationsConditionCode(array $conditions, &$useGlobalObjects = false)
    {
        $evaluateConditionsCode = '';

        $isFirst = true;
        foreach ($conditions as $constraint) {
            $leftValue = $this->buildArgumentEvaluationAccessCode($constraint['leftValue'], $useGlobalObjects);
            $rightValue = $this->buildArgumentEvaluationAccessCode($constraint['rightValue'], $useGlobalObjects);

            if ($constraint['operator'] === 'in') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(' . $rightValue . ' instanceof \SplObjectStorage || ' . $rightValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $leftValue . ' !== NULL && ' . $rightValue . '->contains(' . $leftValue  . ') : in_array(' . $leftValue . ', ' . $rightValue . '))';
            } elseif ($constraint['operator'] === 'contains') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(' . $leftValue . ' instanceof \SplObjectStorage || ' . $leftValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $rightValue . ' !== NULL && ' . $leftValue . '->contains(' . $rightValue  . ') : in_array(' . $rightValue . ', ' . $leftValue . '))';
            } elseif ($constraint['operator'] === 'matches') {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . '(!empty(array_intersect(' . $leftValue . ', ' . $rightValue . ')))';
            } else {
                $evaluateConditionsCode .= ($isFirst === true ? '(' : ' && ') . $leftValue . ' ' . $constraint['operator'] . ' ' . $rightValue;
            }

            $isFirst = false;
        }

        return $evaluateConditionsCode . ')';
    }
protected function buildGlobalRuntimeEvaluationsConditionCode ( array $ conditions , & $ useGlobalObjects = false ) { $ evaluateConditionsCode = '' ; $ isFirst = true ; foreach ( $ conditions as $ constraint ) { $ leftValue = $ this -> buildArgumentEvaluationAccessCode ( $ constraint [ 'leftValue' ] , $ useGlobalObjects ) ; $ rightValue = $ this -> buildArgumentEvaluationAccessCode ( $ constraint [ 'rightValue' ] , $ useGlobalObjects ) ; if ( $ constraint [ 'operator' ] === 'in' ) { $ evaluateConditionsCode .= ( $ isFirst === true ? '(' : ' && ' ) . '(' . $ rightValue . ' instanceof \SplObjectStorage || ' . $ rightValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $ leftValue . ' !== NULL && ' . $ rightValue . '->contains(' . $ leftValue . ') : in_array(' . $ leftValue . ', ' . $ rightValue . '))' ; } elseif ( $ constraint [ 'operator' ] === 'contains' ) { $ evaluateConditionsCode .= ( $ isFirst === true ? '(' : ' && ' ) . '(' . $ leftValue . ' instanceof \SplObjectStorage || ' . $ leftValue . ' instanceof \Doctrine\Common\Collections\Collection ? ' . $ rightValue . ' !== NULL && ' . $ leftValue . '->contains(' . $ rightValue . ') : in_array(' . $ rightValue . ', ' . $ leftValue . '))' ; } elseif ( $ constraint [ 'operator' ] === 'matches' ) { $ evaluateConditionsCode .= ( $ isFirst === true ? '(' : ' && ' ) . '(!empty(array_intersect(' . $ leftValue . ', ' . $ rightValue . ')))' ; } else { $ evaluateConditionsCode .= ( $ isFirst === true ? '(' : ' && ' ) . $ leftValue . ' ' . $ constraint [ 'operator' ] . ' ' . $ rightValue ; } $ isFirst = false ; } return $ evaluateConditionsCode . ')' ; }
Returns the PHP code of the conditions used for global runtime evaluations

@param array $conditions Condition array
@param boolean &$useGlobalObjects Set to true if global objects are used by the condition
@return string The condition code
Returns the PHP code of the conditions used for global runtime evaluations