src/BaseRepository.php
public function applyCriteria()
    {
        // if we're ignoring criteria, the model must be remade without criteria
        if ($this->ignoreCriteria === true) {

            // and make sure that they are re-applied when we stop ignoring
            if ( ! $this->activeCriteria->isEmpty()) {
                $this->makeModel();
                $this->activeCriteria = new Collection();
            }
            return $this;
        }

        if ($this->areActiveCriteriaUnchanged()) return $this;

        // if the new Criteria are different, clear the model and apply the new Criteria
        $this->makeModel();

        $this->markAppliedCriteriaAsActive();


        // apply the collected criteria to the query
        foreach ($this->getCriteriaToApply() as $criteria) {

            if ($criteria instanceof CriteriaInterface) {

                $this->model = $criteria->apply($this->model, $this);
            }
        }

        $this->clearOnceCriteria();

        return $this;
    }
public function applyCriteria()
    {
        // if we're ignoring criteria, the model must be remade without criteria
        if ($this->ignoreCriteria === true) {

            // and make sure that they are re-applied when we stop ignoring
            if ( ! $this->activeCriteria->isEmpty()) {
                $this->makeModel();
                $this->activeCriteria = new Collection();
            }
            return $this;
        }

        if ($this->areActiveCriteriaUnchanged()) return $this;

        // if the new Criteria are different, clear the model and apply the new Criteria
        $this->makeModel();

        $this->markAppliedCriteriaAsActive();


        // apply the collected criteria to the query
        foreach ($this->getCriteriaToApply() as $criteria) {

            if ($criteria instanceof CriteriaInterface) {

                $this->model = $criteria->apply($this->model, $this);
            }
        }

        $this->clearOnceCriteria();

        return $this;
    }
public function applyCriteria ( ) { // if we're ignoring criteria, the model must be remade without criteria if ( $ this -> ignoreCriteria === true ) { // and make sure that they are re-applied when we stop ignoring if ( ! $ this -> activeCriteria -> isEmpty ( ) ) { $ this -> makeModel ( ) ; $ this -> activeCriteria = new Collection ( ) ; } return $ this ; } if ( $ this -> areActiveCriteriaUnchanged ( ) ) return $ this ; // if the new Criteria are different, clear the model and apply the new Criteria $ this -> makeModel ( ) ; $ this -> markAppliedCriteriaAsActive ( ) ; // apply the collected criteria to the query foreach ( $ this -> getCriteriaToApply ( ) as $ criteria ) { if ( $ criteria instanceof CriteriaInterface ) { $ this -> model = $ criteria -> apply ( $ this -> model , $ this ) ; } } $ this -> clearOnceCriteria ( ) ; return $ this ; }
Applies Criteria to the model for the upcoming query

This takes the default/standard Criteria, then overrides
them with whatever is found in the onceCriteria list

@return $this
Applies Criteria to the model for the upcoming query