src/BaseRepository.php
protected function getCriteriaToApply()
    {
        // get the standard criteria
        $criteriaToApply = $this->getCriteria();

        // overrule them with criteria to be applied once
        if ( ! $this->onceCriteria->isEmpty()) {

            foreach ($this->onceCriteria as $onceKey => $onceCriteria) {

                // if there is no key, we can only add the criteria
                if (is_numeric($onceKey)) {

                    $criteriaToApply->push($onceCriteria);
                    continue;
                }

                // if there is a key, override or remove
                // if Null, remove criteria
                if (empty($onceCriteria) || is_a($onceCriteria, NullCriteria::class)) {

                    $criteriaToApply->forget($onceKey);
                    continue;
                }

                // otherwise, overide the criteria
                $criteriaToApply->put($onceKey, $onceCriteria);
            }
        }

        return $criteriaToApply;
    }
protected function getCriteriaToApply()
    {
        // get the standard criteria
        $criteriaToApply = $this->getCriteria();

        // overrule them with criteria to be applied once
        if ( ! $this->onceCriteria->isEmpty()) {

            foreach ($this->onceCriteria as $onceKey => $onceCriteria) {

                // if there is no key, we can only add the criteria
                if (is_numeric($onceKey)) {

                    $criteriaToApply->push($onceCriteria);
                    continue;
                }

                // if there is a key, override or remove
                // if Null, remove criteria
                if (empty($onceCriteria) || is_a($onceCriteria, NullCriteria::class)) {

                    $criteriaToApply->forget($onceKey);
                    continue;
                }

                // otherwise, overide the criteria
                $criteriaToApply->put($onceKey, $onceCriteria);
            }
        }

        return $criteriaToApply;
    }
protected function getCriteriaToApply ( ) { // get the standard criteria $ criteriaToApply = $ this -> getCriteria ( ) ; // overrule them with criteria to be applied once if ( ! $ this -> onceCriteria -> isEmpty ( ) ) { foreach ( $ this -> onceCriteria as $ onceKey => $ onceCriteria ) { // if there is no key, we can only add the criteria if ( is_numeric ( $ onceKey ) ) { $ criteriaToApply -> push ( $ onceCriteria ) ; continue ; } // if there is a key, override or remove // if Null, remove criteria if ( empty ( $ onceCriteria ) || is_a ( $ onceCriteria , NullCriteria :: class ) ) { $ criteriaToApply -> forget ( $ onceKey ) ; continue ; } // otherwise, overide the criteria $ criteriaToApply -> put ( $ onceKey , $ onceCriteria ) ; } } return $ criteriaToApply ; }
Returns the criteria that must be applied for the next query

@return Collection
Returns the criteria that must be applied for the next query