/** * @test */ public function getTcaForTableCanLoadFieldsAddedByExtensions() { $tca = Tx_Oelib_Db::getTcaForTable('fe_users'); self::assertTrue(isset($tca['columns']['tx_oelib_is_dummy_record'])); }
/** * 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 */ 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 = array(); 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); }
/** * Returns the TCA for a certain table. * * @param string $tableName the table name to look up, must not be empty * * @return array[] associative array with the TCA description for this table * * @deprecated 2009-02-12 use Tx_Oelib_Db::getTcaForTable instead */ public function getTcaForTable($tableName) { t3lib_div::logDeprecatedFunction(); return Tx_Oelib_Db::getTcaForTable($tableName); }