Neos\Eel\FlowQuery\FlowQuery::__call PHP Method

__call() public method

Add a new operation to the operation list and return the new FlowQuery object. If the operation is final, we directly compute the result and return the value.
public __call ( string $operationName, array $arguments ) : FlowQuery
$operationName string
$arguments array
return FlowQuery
    public function __call($operationName, array $arguments)
    {
        $updatedOperations = $this->operations;
        $updatedOperations[] = ['name' => $operationName, 'arguments' => $arguments];
        if ($this->operationResolver->isFinalOperation($operationName)) {
            $operationsBackup = $this->operations;
            $contextBackup = $this->context;
            $this->operations = $updatedOperations;
            $operationResult = $this->evaluateOperations();
            $this->operations = $operationsBackup;
            $this->context = $contextBackup;
            return $operationResult;
        } else {
            // non-final operation
            $flowQuery = new FlowQuery($this->context, $updatedOperations);
            $flowQuery->setOperationResolver($this->operationResolver);
            // Only needed for unit tests; hacky!
            return $flowQuery;
        }
    }