Classes/Eel/FilterByReferenceOperation.php
public function evaluate(FlowQuery $flowQuery, array $arguments) {
        if (empty($arguments[0])) {
            throw new FlowQueryException('filterByReference() needs reference property name by which nodes should be filtered', 1545778273);
        }
        if (empty($arguments[1])) {
            throw new FlowQueryException('filterByReference() needs node reference by which nodes should be filtered', 1545778276);
        }

        /** @var NodeInterface $nodeReference */
        list($filterByPropertyPath, $nodeReference) = $arguments;

        $filteredNodes = [];
        foreach ($flowQuery->getContext() as $node) {
            /** @var NodeInterface $node */
            $propertyValue = $node->getProperty($filterByPropertyPath);
            if ($nodeReference === $propertyValue || (is_array($propertyValue) && in_array($nodeReference, $propertyValue, TRUE))) {
                $filteredNodes[] = $node;
            }
        }

        $flowQuery->setContext($filteredNodes);
    }
public function evaluate(FlowQuery $flowQuery, array $arguments) {
        if (empty($arguments[0])) {
            throw new FlowQueryException('filterByReference() needs reference property name by which nodes should be filtered', 1545778273);
        }
        if (empty($arguments[1])) {
            throw new FlowQueryException('filterByReference() needs node reference by which nodes should be filtered', 1545778276);
        }

        /** @var NodeInterface $nodeReference */
        list($filterByPropertyPath, $nodeReference) = $arguments;

        $filteredNodes = [];
        foreach ($flowQuery->getContext() as $node) {
            /** @var NodeInterface $node */
            $propertyValue = $node->getProperty($filterByPropertyPath);
            if ($nodeReference === $propertyValue || (is_array($propertyValue) && in_array($nodeReference, $propertyValue, TRUE))) {
                $filteredNodes[] = $node;
            }
        }

        $flowQuery->setContext($filteredNodes);
    }
public function evaluate ( FlowQuery $ flowQuery , array $ arguments ) { if ( empty ( $ arguments [ 0 ] ) ) { throw new FlowQueryException ( 'filterByReference() needs reference property name by which nodes should be filtered' , 1545778273 ) ; } if ( empty ( $ arguments [ 1 ] ) ) { throw new FlowQueryException ( 'filterByReference() needs node reference by which nodes should be filtered' , 1545778276 ) ; } /** @var NodeInterface $nodeReference */ list ( $ filterByPropertyPath , $ nodeReference ) = $ arguments ; $ filteredNodes = [ ] ; foreach ( $ flowQuery -> getContext ( ) as $ node ) { /** @var NodeInterface $node */ $ propertyValue = $ node -> getProperty ( $ filterByPropertyPath ) ; if ( $ nodeReference === $ propertyValue || ( is_array ( $ propertyValue ) && in_array ( $ nodeReference , $ propertyValue , TRUE ) ) ) { $ filteredNodes [ ] = $ node ; } } $ flowQuery -> setContext ( $ filteredNodes ) ; }
First argument is property to filter by, must be of reference of references type.
Second is object to filter by, must be Node.

@param FlowQuery $flowQuery
@param array $arguments The arguments for this operation.
@return void
@throws FlowQueryException
@throws \Neos\ContentRepository\Exception\NodeException
First argument is property to filter by must be of reference of references type . Second is object to filter by must be Node .