public function makeSearch($lang, $postTypeID, $term)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Categories', 'read')) {
            return $this->noPermission();
        }

        $orderBy = (isset($_GET['order'])) ? $_GET['order'] : 'categoryID';
        $orderType = (isset($_GET['type'])) ? $_GET['type'] : 'ASC';

        $conditions = array();
        if ($postTypeID != 0) {
            $conditions = array(
                0 => array(
                    'where',
                    'postTypeID',
                    '=',
                    $postTypeID
                )
            );
        }

        $column = [
            "Field" => "title",
            "Type" => "json"
        ];
        $columns = [];
        array_push($columns, (object) $column);

        $results = Search::searchByTerm('categories', $term, Category::$rowsPerPage, true, $columns, [], $orderBy, $orderType, [], $conditions);
        return Language::filterRows($results);
    }