DiscussionModel::getWheres PHP Method

getWheres() protected method

Checks for any set filters and if they exist, returns the where clauses from the filters.
protected getWheres ( array $categoryIDs = [] ) : array
$categoryIDs array The category IDs from the where clause.
return array The where clauses from the filters.
    protected function getWheres($categoryIDs = [])
    {
        $wheres = [];
        $filters = $this->getFiltersFromKeys($this->getFilters());
        foreach ($filters as $filter) {
            if (!empty($categoryIDs)) {
                $setKey = val('setKey', $filter);
                $filterSetCategories = val('categories', val($setKey, self::getAllowedFilters()));
                if (!empty($filterSetCategories) and array_diff($categoryIDs, $filterSetCategories)) {
                    $filter['wheres'] = [];
                }
            }
            $wheres = $this->combineWheres(val('wheres', $filter, []), $wheres);
        }
        return $wheres;
    }