public function filterQuery(QueryBuilder &$query, &$selects = null)
    {
        //run the parent method
        parent::filterQuery($query, $selects);

        //if there is no value, return
        if (!$this->getOption('value')) {
            return;
        }

        $query->where($this->getOption('foreign_key'), '=', $this->getOption('value'));
    }
public function filterQuery(QueryBuilder &$query, &$selects = null)
    {
        //run the parent method
        parent::filterQuery($query, $selects);

        //if there is no value, return
        if (!$this->getOption('value')) {
            return;
        }

        $query->where($this->getOption('foreign_key'), '=', $this->getOption('value'));
    }
public function filterQuery ( QueryBuilder & $ query , & $ selects = null ) { //run the parent method parent :: filterQuery ( $ query , $ selects ) ; //if there is no value, return if ( ! $ this -> getOption ( 'value' ) ) { return ; } $ query -> where ( $ this -> getOption ( 'foreign_key' ) , '=' , $ this -> getOption ( 'value' ) ) ; }
Filters a query object with this item's data given a model.

@param \Illuminate\Database\Query\Builder $query
@param array                              $selects
Filters a query object with this item s data given a model .