/** * 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. * * @param string $operationName * @param array $arguments * @return \TYPO3\Eel\FlowQuery\FlowQuery */ public function __call($operationName, array $arguments) { $updatedOperations = $this->operations; $updatedOperations[] = array('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; } }