protected function findByWhereClause($whereClause = '', $sorting = '', $limit = '')
    {
        $orderBy = '';

        $tca = \Tx_Oelib_Db::getTcaForTable($this->getTableName());
        if ($sorting !== '') {
            $orderBy = $sorting;
        } elseif (isset($tca['ctrl']['default_sortby'])) {
            $matches = [];
            if (preg_match(
                '/^ORDER BY (.+)$/',
                $tca['ctrl']['default_sortby'],
                $matches
            )) {
                $orderBy = $matches[1];
            }
        }

        $completeWhereClause = ($whereClause === '')
            ? ''
            : $whereClause . ' AND ';

        $rows = \Tx_Oelib_Db::selectMultiple(
            '*',
            $this->getTableName(),
            $completeWhereClause . $this->getUniversalWhereClause(),
            '',
            $orderBy,
            $limit
        );

        return $this->getListOfModels($rows);
    }
protected function findByWhereClause($whereClause = '', $sorting = '', $limit = '')
    {
        $orderBy = '';

        $tca = \Tx_Oelib_Db::getTcaForTable($this->getTableName());
        if ($sorting !== '') {
            $orderBy = $sorting;
        } elseif (isset($tca['ctrl']['default_sortby'])) {
            $matches = [];
            if (preg_match(
                '/^ORDER BY (.+)$/',
                $tca['ctrl']['default_sortby'],
                $matches
            )) {
                $orderBy = $matches[1];
            }
        }

        $completeWhereClause = ($whereClause === '')
            ? ''
            : $whereClause . ' AND ';

        $rows = \Tx_Oelib_Db::selectMultiple(
            '*',
            $this->getTableName(),
            $completeWhereClause . $this->getUniversalWhereClause(),
            '',
            $orderBy,
            $limit
        );

        return $this->getListOfModels($rows);
    }
protected function findByWhereClause ( $ whereClause = '' , $ sorting = '' , $ limit = '' ) { $ orderBy = '' ; $ tca = \ Tx_Oelib_Db :: getTcaForTable ( $ this -> getTableName ( ) ) ; if ( $ sorting !== '' ) { $ orderBy = $ sorting ; } elseif ( isset ( $ tca [ 'ctrl' ] [ 'default_sortby' ] ) ) { $ matches = [ ] ; if ( preg_match ( '/^ORDER BY (.+)$/' , $ tca [ 'ctrl' ] [ 'default_sortby' ] , $ matches ) ) { $ orderBy = $ matches [ 1 ] ; } } $ completeWhereClause = ( $ whereClause === '' ) ? '' : $ whereClause . ' AND ' ; $ rows = \ Tx_Oelib_Db :: selectMultiple ( '*' , $ this -> getTableName ( ) , $ completeWhereClause . $ this -> getUniversalWhereClause ( ) , '' , $ orderBy , $ limit ) ; return $ this -> getListOfModels ( $ rows ) ; }
Retrieves all non-deleted, non-hidden models from the DB which match the
given where clause.

@param string $whereClause
WHERE clause for the record to retrieve must be quoted and SQL
safe, may be empty
@param string $sorting
the sorting for the found records, must be a valid DB field
optionally followed by "ASC" or "DESC", may be empty
@param string $limit the LIMIT value ([begin,]max), may be empty

@return \Tx_Oelib_List<\Tx_Oelib_Model> all models found in DB for the given where clause,
will be an empty list if no models were found
Retrieves all non - deleted non - hidden models from the DB which match the given where clause .