lib/Collection/QueryType/Handler/Traits/ObjectStateFilterTrait.php
private function getObjectStateFilterCriteria(ParameterCollectionInterface $parameterCollection): ?Criterion
    {
        if ($parameterCollection->getParameter('filter_by_object_state')->getValue() !== true) {
            return null;
        }

        $objectStates = $parameterCollection->getParameter('object_states')->getValue() ?? [];
        if (count($objectStates) === 0) {
            return null;
        }

        $criteria = [];
        foreach ($this->getObjectStateIds($objectStates) as $stateIds) {
            $criteria[] = new Criterion\ObjectStateId($stateIds);
        }

        return new Criterion\LogicalAnd($criteria);
    }
private function getObjectStateFilterCriteria(ParameterCollectionInterface $parameterCollection): ?Criterion
    {
        if ($parameterCollection->getParameter('filter_by_object_state')->getValue() !== true) {
            return null;
        }

        $objectStates = $parameterCollection->getParameter('object_states')->getValue() ?? [];
        if (count($objectStates) === 0) {
            return null;
        }

        $criteria = [];
        foreach ($this->getObjectStateIds($objectStates) as $stateIds) {
            $criteria[] = new Criterion\ObjectStateId($stateIds);
        }

        return new Criterion\LogicalAnd($criteria);
    }
private function getObjectStateFilterCriteria ( ParameterCollectionInterface $ parameterCollection ) : ? Criterion { if ( $ parameterCollection -> getParameter ( 'filter_by_object_state' ) -> getValue ( ) !== true ) { return null ; } $ objectStates = $ parameterCollection -> getParameter ( 'object_states' ) -> getValue ( ) ?? [ ] ; if ( count ( $ objectStates ) === 0 ) { return null ; } $ criteria = [ ] ; foreach ( $ this -> getObjectStateIds ( $ objectStates ) as $ stateIds ) { $ criteria [ ] = new Criterion \ ObjectStateId ( $ stateIds ) ; } return new Criterion \ LogicalAnd ( $ criteria ) ; }
Returns the criteria used to filter content by object state.
Returns the criteria used to filter content by object state .