Fetches search parameter from GET/POST/session, prepares search
SQL (search::GetWhere()), and executes it forming the list of
found articles. Article list is stored at search::_aArticleList
array.

@return null
17850
public function init()
    {
        parent::init();

        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // #1184M - special char search
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $sSearchParamForQuery = trim($oConfig->getRequestParameter('searchparam', true));

        // searching in category ?
        $sInitialSearchCat = $this->_sSearchCatId = rawurldecode($oConfig->getRequestParameter('searchcnid'));

        // searching in vendor #671
        $sInitialSearchVendor = rawurldecode($oConfig->getRequestParameter('searchvendor'));

        // searching in Manufacturer #671
        $sManufacturerParameter = $oConfig->getRequestParameter('searchmanufacturer');
        $sInitialSearchManufacturer = $this->_sSearchManufacturer = rawurldecode($sManufacturerParameter);

        $this->_blEmptySearch = false;
        if (!$sSearchParamForQuery && !$sInitialSearchCat && !$sInitialSearchVendor && !$sInitialSearchManufacturer) {
            //no search string
            $this->_aArticleList = null;
            $this->_blEmptySearch = true;

            return false;
        }

        // config allows to search in Manufacturers ?
        if (!$myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
            $sInitialSearchManufacturer = null;
        }

        // searching ..
        /** @var \OxidEsales\Eshop\Application\Model\Search $oSearchHandler */
        $oSearchHandler = oxNew(\OxidEsales\Eshop\Application\Model\Search::class);
        $oSearchList = $oSearchHandler->getSearchArticles(
            $sSearchParamForQuery,
            $sInitialSearchCat,
            $sInitialSearchVendor,
            $sInitialSearchManufacturer,
            $this->getSortingSql($this->getSortIdent())
        );

        // list of found articles
        $this->_aArticleList = $oSearchList;
        $this->_iAllArtCnt = 0;

        // skip count calculation if no articles in list found
        if ($oSearchList->count()) {
            $this->_iAllArtCnt = $oSearchHandler->getSearchArticleCount(
                $sSearchParamForQuery,
                $sInitialSearchCat,
                $sInitialSearchVendor,
                $sInitialSearchManufacturer
            );
        }

        $iNrofCatArticles = (int) $myConfig->getConfigParam('iNrofCatArticles');
        $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
        $this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles);
    }
793918
public function searchPosts()
    {
        $query = Vocabulary::find()->select('post_id, thread_id')->joinWith(['posts.author', 'posts.thread'])->andWhere(['is not', 'post_id', null]);
        if (Podium::getInstance()->user->isGuest) {
            $query->joinWith(['posts.forum' => function ($q) {
                $q->andWhere([Forum::tableName() . '.visible' => 1])->joinWith(['category' => function ($q) {
                    $q->andWhere([Category::tableName() . '.visible' => 1]);
                }]);
            }]);
        }
        if (!empty($this->query)) {
            $words = explode(' ', preg_replace('/\s+/', ' ', $this->query));
            $countWords = 0;
            foreach ($words as $word) {
                $query->orWhere(['like', 'word', $word]);
                $countWords++;
            }
            $query->groupBy('post_id');
            if ($this->match == 'all' && $countWords > 1) {
                $query->select(['post_id', 'thread_id', 'COUNT(post_id) AS c'])->having(['>', 'c', $countWords - 1]);
            }
        }
        $this->prepareQuery($query);
        $sort = [
            'defaultOrder' => ['post_id' => SORT_DESC],
            'attributes' => [
                'post_id' => [
                    'asc' => ['post_id' => SORT_ASC],
                    'desc' => ['post_id' => SORT_DESC],
                    'default' => SORT_DESC,
                ],
            ]
        ];
        return new ActiveDataProvider([
            'query' => $query,
            'sort' => $sort,
        ]);
    }
969586
protected function prepateListSearchParams()
    {
        $groupName = basename(NewsSearchFront::className());
        $params = [];
        $params[$groupName] = Yii::$app->request->queryParams;
        if (!empty($this->module->params['titleMinLength'])) {
            $params[$groupName]['titleMinLength'] = $this->module->params['titleMinLength'];
        }
        if (!empty($this->module->params['bodyMinLength'])) {
            $params[$groupName]['bodyMinLength'] = $this->module->params['bodyMinLength' ];
        }
        return $params;
    }
994521
public function getRawSql()
    {
        $search = array();
        $replace = array();
        $params = $this->getParams();
        ksort($params, SORT_STRING);
        foreach ($params as $key => $value) {
            if (is_int($key)) {
                $key = '?';
            }
            $search[] = $key;
            if (is_string($value)) {
                $value = "'$value'";
            }
            $replace[] = $value;
        }
        return str_replace($search, $replace, $this->getSql());
    }
357184
public function getTopArticleList()
    {
        if ($this->_aTopArticleList === null) {
            $this->_aTopArticleList = false;
            if ($this->_getLoadActionsParam()) {
                // start list
                $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
                $oArtList->loadActionArticles('OXTOPSTART');
                if ($oArtList->count()) {
                    $this->_aTopArticleList = $oArtList;
                }
            }
        }

        return $this->_aTopArticleList;
    }
1059008
protected function getNewPosts()
    {
        Container::get('hooks')->fire('model.index.get_new_posts_start');

        $query['select'] = ['f.id', 'f.last_post'];
        $query['where'] = [
            ['fp.read_forum' => 'IS NULL'],
            ['fp.read_forum' => '1']
        ];
        $query = DB::forTable('forums')
            ->table_alias('f')
            ->select_many($query['select'])
            ->left_outer_join(
                DB::prefix().'forum_perms',
                '(`fp`.`forum_id`=`f`.`id` AND `fp`.`group_id`='.User::get()->g_id.')',
                'fp'
            )
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.forum_id', '=', 'f.id'), 'fp')
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.group_id', '=',
// User::get()->g_id), null, true)
//            ->where_any_is($query['where'])
            ->where_raw('(fp.read_forum IS NULL OR fp.read_forum = 1)')
            ->where_gt('f.last_post', User::get()->last_visit);

        $query = Container::get('hooks')->fireDB('model.index.query_get_new_posts', $query);

        $query = $query->find_result_set();

        $forums = $new_topics = [];
        $tracked_topics = Track::getTrackedTopics();

        foreach ($query as $cur_forum) {
            if (!isset($tracked_topics['forums'][$cur_forum->id]) ||
                $tracked_topics['forums'][$cur_forum->id] < $cur_forum->last_post) {
                $forums[$cur_forum->id] = $cur_forum->last_post;
            }
        }

        if (!empty($forums)) {
            if (empty($tracked_topics['topics'])) {
                $new_topics = $forums;
            } else {
                $query['select'] = ['forum_id', 'id', 'last_post'];

                $query = DB::forTable('topics')
                    ->select_many($query['select'])
                    ->where_in('forum_id', array_keys($forums))
                    ->where_gt('last_post', User::get()->last_visit)
                    ->where_null('moved_to');

                $query = Container::get('hooks')->fireDB('model.index.get_new_posts_query', $query);

                $query = $query->find_result_set();

                foreach ($query as $cur_topic) {
                    if (!isset($new_topics[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['forums'][$cur_topic->forum_id]) ||
                            $tracked_topics['forums'][$cur_topic->forum_id] < $forums[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['topics'][$cur_topic->id]) ||
                            $tracked_topics['topics'][$cur_topic->id] < $cur_topic->last_post)) {
                        $new_topics[$cur_topic->forum_id] = $forums[$cur_topic->forum_id];
                    }
                }
            }
        }

        $new_topics = Container::get('hooks')->fire('model.index.get_new_posts', $new_topics);

        return $new_topics;
    }
1331938
protected function _getQuery()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $sArticleTable = $this->_getViewName('oxarticles');
        $sView = $this->_getViewName('oxobject2category');

        $sSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $sSynchSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        // category selected or not ?
        if (!$sSelId) {
            $sQAdd = " from {$sArticleTable} where 1 ";
            $sQAdd .= $myConfig->getConfigParam('blVariantsSelection') ? '' : " and {$sArticleTable}.oxparentid = '' ";
        } elseif ($sSynchSelId && $sSelId != $sSynchSelId) {
            // selected category ?
            $blVariantsSelectionParameter = $myConfig->getConfigParam('blVariantsSelection');
            $sSqlIfTrue = " ({$sArticleTable}.oxid=oxobject2category.oxobjectid " .
                          "or {$sArticleTable}.oxparentid=oxobject2category.oxobjectid)";
            $sSqlIfFalse = " {$sArticleTable}.oxid=oxobject2category.oxobjectid ";
            $sVariantsSelectionSnippet = $blVariantsSelectionParameter ? $sSqlIfTrue : $sSqlIfFalse;

            $sQAdd = " from {$sView} as oxobject2category left join {$sArticleTable} on {$sVariantsSelectionSnippet}" .
                     " where oxobject2category.oxcatnid = " . $oDb->quote($sSelId) . " ";
        } elseif ($myConfig->getConfigParam('blBidirectCross')) {
            $sQAdd = " from oxobject2article " .
                     " inner join {$sArticleTable} on ( oxobject2article.oxobjectid = {$sArticleTable}.oxid " .
                     " or oxobject2article.oxarticlenid = {$sArticleTable}.oxid ) " .
                     " where ( oxobject2article.oxarticlenid = " . $oDb->quote($sSelId) .
                     " or oxobject2article.oxobjectid = " . $oDb->quote($sSelId) . " ) " .
                     " and {$sArticleTable}.oxid != " . $oDb->quote($sSelId) . " ";
        } else {
            $sQAdd = " from oxobject2article left join {$sArticleTable} " .
                     "on oxobject2article.oxobjectid={$sArticleTable}.oxid " .
                     " where oxobject2article.oxarticlenid = " . $oDb->quote($sSelId) . " ";
        }

        if ($sSynchSelId && $sSynchSelId != $sSelId) {
            if ($myConfig->getConfigParam('blBidirectCross')) {
                $sSubSelect = "select {$sArticleTable}.oxid from oxobject2article " .
                              "left join {$sArticleTable} on (oxobject2article.oxobjectid={$sArticleTable}.oxid " .
                              "or oxobject2article.oxarticlenid={$sArticleTable}.oxid) " .
                              "where (oxobject2article.oxarticlenid = " . $oDb->quote($sSynchSelId) .
                              " or oxobject2article.oxobjectid = " . $oDb->quote($sSynchSelId) . " )";
            } else {
                $sSubSelect = "select {$sArticleTable}.oxid from oxobject2article " .
                              "left join {$sArticleTable} on oxobject2article.oxobjectid={$sArticleTable}.oxid " .
                              "where oxobject2article.oxarticlenid = " . $oDb->quote($sSynchSelId) . " ";
            }

            $sSubSelect .= " and {$sArticleTable}.oxid IS NOT NULL ";
            $sQAdd .= " and {$sArticleTable}.oxid not in ( $sSubSelect ) ";
        }

        // #1513C/#1826C - skip references, to not existing articles
        $sQAdd .= " and {$sArticleTable}.oxid IS NOT NULL ";

        // skipping self from list
        $sId = ($sSynchSelId) ? $sSynchSelId : $sSelId;
        $sQAdd .= " and {$sArticleTable}.oxid != " . $oDb->quote($sId) . " ";

        return $sQAdd;
    }
847446
protected function _getQuery()
    {
        $myConfig = Registry::getConfig();
        $oxidId = Registry::getConfig()->getRequestEscapedParameter('oxid');
        $synchId = Registry::getConfig()->getRequestEscapedParameter('synchoxid');
        $db = DatabaseProvider::getDb();
        $this->containerId = Registry::getConfig()->getRequestEscapedParameter('cmpid');

        $articleTable = $this->_getViewName('oxarticles');
        $object2categoryTable = $this->_getViewName('oxobject2category');

        // category selected or not ?
        if (!$oxidId) {
            $outputQuery = " from {$articleTable} where 1 ";
            $outputQuery .= $myConfig->getConfigParam('blVariantsSelection') ? '' : " and {$articleTable}.oxparentid = '' ";
        } else {
            // selected category ?
            if ($synchId && $oxidId != $synchId) {
                $blVariantsSelectionParameter = $myConfig->getConfigParam('blVariantsSelection');
                $trueResponse = " ( {$articleTable}.oxid=$object2categoryTable.oxobjectid " .
                                "or {$articleTable}.oxparentid=$object2categoryTable.oxobjectid )";
                $failResponse = " {$articleTable}.oxid=$object2categoryTable.oxobjectid ";
                $variantSelectionSql = $blVariantsSelectionParameter ? $trueResponse : $failResponse;

                $outputQuery = " from $object2categoryTable left join {$articleTable} on {$variantSelectionSql}" .
                               " where $object2categoryTable.oxcatnid = " . $db->quote($oxidId) . " ";
            } else {
                $outputQuery = " from oxaccessoire2article left join {$articleTable} " .
                               "on oxaccessoire2article.oxobjectid={$articleTable}.oxid " .
                               " where oxaccessoire2article.oxarticlenid = " . $db->quote($oxidId) . " ";
            }
        }

        if ($synchId && $synchId != $oxidId) {
            // performance
            $subSelect = ' select oxaccessoire2article.oxobjectid from oxaccessoire2article ';
            $subSelect .= " where oxaccessoire2article.oxarticlenid = " . $db->quote($synchId) . " ";
            $outputQuery .= " and {$articleTable}.oxid not in ( $subSelect )";
        }

        // skipping self from list
        $sId = ($synchId) ? $synchId : $oxidId;
        $outputQuery .= " and {$articleTable}.oxid != " . $db->quote($sId) . " ";

        // creating AJAX component
        return $outputQuery;
    }
1202925
public function getSearchCriteria()
    {
        /* setting the default pagination for the page */
        if (!Yii::$app->session->get($this->MainModel . 'Pagination')) {
            Yii::$app->session->set($this->MainModel . 'Pagination', Yii::$app->getModule('core')->recordsPerPage);
        }
        $savedQueryParams = Yii::$app->session->get($this->MainModel . 'QueryParams');
        if (count($savedQueryParams)) {
            $queryParams = $savedQueryParams;
        } else {
            $queryParams = [substr($this->MainModelSearch, strrpos($this->MainModelSearch, "\\") + 1) => $this->defaultQueryParams];
        }
        /* use the same filters as before */
        if (count(Yii::$app->request->queryParams)) {
            $queryParams = array_merge($queryParams, Yii::$app->request->queryParams);
        }

        if (isset($queryParams['page'])) {
            $_GET['page'] = $queryParams['page'];
        }
        if (Yii::$app->request->getIsPjax()) {
            $this->layout = false;
        }
        Yii::$app->session->set($this->MainModel . 'QueryParams', $queryParams);
        $this->searchModel = new $this->MainModelSearch;
        $this->dataProvider = $this->searchModel->search($queryParams);
    }
613113
function find( $pattern, $limit, $offset, $orderby ) {
		global $wpdb;
		$results = [];

		$sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts}
				WHERE post_type IN ('part','chapter','front-matter','back-matter')
				AND post_status NOT IN ('trash','inherit')
				ORDER BY ID ";
		$sql .= ( 'asc' === $orderby ) ? 'ASC' : 'DESC';
		if ( $limit > 0 ) {
			$sql .= sprintf( ' LIMIT %d,%d ', $offset, $limit );
		}

		$posts = $wpdb->get_results( $sql ); // @codingStandardsIgnoreLine

		if ( count( $posts ) > 0 ) {
			foreach ( $posts as $key => $post ) {
				$matches = $this->matches( $pattern, $post->post_content, $post->ID );
				if ( $matches ) {
					foreach ( $matches as $match ) {
						$match->title = $post->post_title;
					}
					$results = array_merge( $results, $matches );
				}
				unset( $posts[ $key ] ); // Reduce memory usage
			}
		}
		return $results;
	}
404014
protected function _getQuery()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sArticleTable = $this->_getViewName('oxarticles');
        $sOCatView = $this->_getViewName('oxobject2category');
        $sOAttrView = $this->_getViewName('oxobject2attribute');

        $sDelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $sSynchDelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        // category selected or not ?
        if (!$sDelId) {
            // performance
            $sQAdd = " from $sArticleTable where 1 ";
            $sQAdd .= $myConfig->getConfigParam('blVariantsSelection') ? '' : " and $sArticleTable.oxparentid = '' ";
        } elseif ($sSynchDelId && $sDelId != $sSynchDelId) {
            // selected category ?
            $blVariantsSelectionParameter = $myConfig->getConfigParam('blVariantsSelection');
            $sSqlIfTrue = " ( {$sArticleTable}.oxid=oxobject2category.oxobjectid " .
                          "or {$sArticleTable}.oxparentid=oxobject2category.oxobjectid)";
            $sSqlIfFalse = " {$sArticleTable}.oxid=oxobject2category.oxobjectid ";
            $sVariantSelectionSql = $blVariantsSelectionParameter ? $sSqlIfTrue : $sSqlIfFalse;
            $sQAdd = " from {$sOCatView} as oxobject2category left join {$sArticleTable} on {$sVariantSelectionSql}" .
                     " where oxobject2category.oxcatnid = " . $oDb->quote($sDelId) . " ";
        } else {
            $sQAdd = " from {$sOAttrView} left join {$sArticleTable} " .
                     "on {$sArticleTable}.oxid={$sOAttrView}.oxobjectid " .
                     "where {$sOAttrView}.oxattrid = " . $oDb->quote($sDelId) .
                     " and {$sArticleTable}.oxid is not null ";
        }

        if ($sSynchDelId && $sSynchDelId != $sDelId) {
            $sQAdd .= " and {$sArticleTable}.oxid not in ( select {$sOAttrView}.oxobjectid from {$sOAttrView} " .
                      "where {$sOAttrView}.oxattrid = " . $oDb->quote($sSynchDelId) . " ) ";
        }

        return $sQAdd;
    }
1321618
public function columnSearch()
    {
        $columns = $this->request->get('columns', []);

        foreach ($columns as $index => $column) {

            if (!$this->request->isColumnSearchable($index)) {
                continue;
            }

            $column = $this->getColumnName($index);

            if (isset($this->columnDef['filter'][$column])) {
                $columnDef = $this->columnDef['filter'][$column];
                // get a raw keyword (without wildcards)
                $keyword   = $this->getSearchKeyword($index, true);
                $builder   = $this->getQueryBuilder();

                if ($columnDef['method'] instanceof Closure) {
                    $whereQuery = $builder->newQuery();
                    call_user_func_array($columnDef['method'], [$whereQuery, $keyword]);
                    $builder->addNestedWhereQuery($whereQuery);
                } else {
                    $this->compileColumnQuery(
                            $builder, $columnDef['method'], $columnDef['parameters'], $column, $keyword
                    );
                }
            } else {
                if (count(explode('.', $column)) > 1) {
                    $eagerLoads     = $this->getEagerLoads();
                    $parts          = explode('.', $column);
                    $relationColumn = array_pop($parts);
                    $relation       = implode('.', $parts);
                    if (in_array($relation, $eagerLoads)) {
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
                    }
                }

                $column          = $this->castColumn($column);
                $keyword         = $this->getSearchKeyword($index);
                $caseInsensitive = $this->isCaseInsensitive();

                if (!$caseInsensitive) {
                    $column = strstr($column, '(') ? $this->connection->raw($column) : $column;
                }

                $this->compileColumnSearch($index, $column, $keyword, $caseInsensitive);
            }

            $this->isFilterApplied = true;
        }
    }
143099
protected function _getQuery()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $sSynchArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        $sAttrViewName = $this->_getViewName('oxattribute');
        $sO2AViewName = $this->_getViewName('oxobject2attribute');
        if ($sArtId) {
            // all categories article is in
            $sQAdd = " from {$sO2AViewName} left join {$sAttrViewName} " .
                     "on {$sAttrViewName}.oxid={$sO2AViewName}.oxattrid " .
                     " where {$sO2AViewName}.oxobjectid = " . $oDb->quote($sArtId) . " ";
        } else {
            $sQAdd = " from {$sAttrViewName} where {$sAttrViewName}.oxid not in ( select {$sO2AViewName}.oxattrid " .
                     "from {$sO2AViewName} left join {$sAttrViewName} " .
                     "on {$sAttrViewName}.oxid={$sO2AViewName}.oxattrid " .
                     " where {$sO2AViewName}.oxobjectid = " . $oDb->quote($sSynchArtId) . " ) ";
        }

        return $sQAdd;
    }
927290
public function listTask()
	{
		$query = $this->resolveModel();

		$properties = $query->getStructure()->getTableColumns($query->getTableName());
		$properties = $this->normalizeProperties($properties);

		$searches = array();

		// Build a list of incoming filters from
		// the propertes of the model
		foreach ($properties as $property => $type)
		{
			if ($property == $query->getPrimaryKey())
			{
				continue;
			}

			if ($type == 'text')
			{
				$searches[] = $property;
				continue;
			}

			if ($type == 'integer')
			{
				$dflt = null;

				// 'state' is a very commonly used field and we want
				// it to default to published entries
				if ($property == 'state')
				{
					$dflt = $query::STATE_PUBLISHED;
					if (User::authorise('core.manage', $this->_option))
					{
						$dflt = null;
					}
				}

				$filters[$property] = Request::getInt($property, $dflt);

				// 'access' is another commonly used field where we
				// want to control what values are actually allowed
				if ($property == 'access')
				{
					if (is_null($filters[$property]))
					{
						$filters[$property] = User::getAuthorisedViewLevels();
					}
				}
			}
			else
			{
				$filters[$property] = Request::getVar($property);
			}
		}

		$filters['sort'] = Request::getString('sort', $query->orderBy);
		$filters['sort_Dir'] = Request::getWord('sort_Dir', $query->orderDir);

		if (!isset($properties[$filters['sort']]))
		{
			$filters['sort'] = $query->orderBy;
		}

		if (!in_array($filters['sort_Dir'], array('asc', 'desc')))
		{
			$filters['sort_Dir'] = $query->orderDir;
		}

		foreach ($filters as $field => $value)
		{
			if ($field == 'sort' || $field == 'sort_Dir')
			{
				continue;
			}

			if (is_null($value))
			{
				continue;
			}

			if (is_array($value))
			{
				$query->whereIn($field, $value);
			}
			else
			{
				if ($properties[$field] == 'string' && !$value)
				{
					continue;
				}

				if ($properties[$field] == 'date' && !$value)
				{
					continue;
				}

				$query->whereEquals($field, $value);
			}
		}

		// Are searching for anything?
		if ($search = (string)Request::getString('search'))
		{
			foreach ($searches as $i => $property)
			{
				if ($i == 0)
				{
					$query->whereLike($property, $search, 1);
				}
				else
				{
					$query->orWhereLike($property, $search, 1);
				}
			}
			$query->resetDepth();
		}

		// Get a total record count
		$total = with(clone $query)->total();

		// Build the response
		$response = new stdClass;
		$response->records = array();
		$response->total = $total;

		if ($response->total)
		{
			$base = rtrim(Request::base(), '/');

			$rows = $query
				->order($filters['sort'], $filters['sort_Dir'])
				->paginated('limitstart', 'limit')
				->rows();

			foreach ($rows as $row)
			{
				$obj = $row->toObject();
				foreach ($properties as $property => $type)
				{
					if ($type == 'date')
					{
						if ($obj->$property && $obj->$property != '0000-00-00 00:00:00')
						{
							$obj->$property = with(new Date($obj->$property))->format('Y-m-d\TH:i:s\Z');
						}
					}
					if ($type == 'text')
					{
						unset($obj->$property);
					}
				}
				if (method_exists($row, 'link'))
				{
					$obj->url = str_replace('/api', '', $base . '/' . ltrim(Route::url($row->link()), '/'));
				}

				$response->records[] = $obj;
			}
		}

		$this->send($response);
	}
212878
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = [];
            if ($this->_getLoadActionsParam()) {
                // start list
                $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
                $oArtList->loadActionArticles('OXSTART');
                if ($oArtList->count()) {
                    $this->_aArticleList = $oArtList;
                }
            }
        }

        return $this->_aArticleList;
    }
1331291
public function find($where = null, $orderby = null, $onpage = null, $page = null)
  {
    $this->items = null;

    $q = $this->getManager()
      ->getQueryBuilder()
      ->select($this->getTable())
      ->where($where)
      ->orderby($orderby)
      ->page($page, $onpage);

    return $this->fetch($q);
  }
1345679
public function indexAction()
    {
        /* @todo: move this into a listener.
         *
         * The following lines allow to override get param[q] with the
         * param from route. This feature is needed for a landing-page feature, where
         * human readable urls like http://yawik.org/demo/de/jobs/sales.html
         *
         * move the Logic into a Listener, which can be activated, if needed
         */
        $request = $this->getRequest();
        $getParams = $request->getQuery();
        $routeParams = $this->params()->fromRoute();
        if (isset($routeParams['q']) && !isset($getParams['q'])) {
            $getParams['q']=$routeParams['q'];
        }

        $result = $this->pagination([
                'params' => ['Jobs_Board', [
                    'q',
                    'count' => $this->options['count'],
                    'page' => 1,
                    'l',
                    'd' => 10]
                ],
                'form' => ['as' => 'filterForm', 'Jobs/JobboardSearch'],
                'paginator' => ['as' => 'jobs', 'Jobs/Board']
            ]);

        $organizationImageCache = $this->imageFileCacheManager;

        $result['organizationImageCache'] = $organizationImageCache;

        return new ViewModel($result);
    }