Neos\Eel\FlowQuery\FlowQuery::setContext PHP Метод

setContext() публичный Метод

Should only be called inside an operation.
public setContext ( array | Traversable $context )
$context array | Traversable
    public function setContext($context)
    {
        $this->context = $context;
    }

Usage Example

 /**
  * {@inheritdoc}
  *
  * @param FlowQuery $flowQuery the FlowQuery object
  * @param array $arguments Ignored for this operation
  * @return void
  */
 public function evaluate(FlowQuery $flowQuery, array $arguments)
 {
     $context = $flowQuery->getContext();
     if (count($context) > 0) {
         $flowQuery->setContext([end($context)]);
     } else {
         $flowQuery->setContext([]);
     }
 }
All Usage Examples Of Neos\Eel\FlowQuery\FlowQuery::setContext