[TYPO3-german] pi_exec_query in Backend TCA
Dr. Ronald P. Steiner
Ronald.Steiner at googlemail.com
Fri Jul 11 10:25:14 CEST 2008
Hallo Liste,
ich möchte im BackEnd (TCA) alle Zeilen der tx_dam DB-Tabelle anzeigen,
die zu bestimmten Kategorien gehören. Im FrontEnd (ContentElement) mache
ich das so:
$items = array();
$table = 'tx_dam';
$addWhere = $this->cObj->enableFields($sourceTable);
$mm_cat = array(
'table' => 'tx_dam_cat',
'mmtable' => 'tx_dam_mm_cat',
'catUidList' => '3,7'
);
$this->internal['results_at_a_time'] = 1000;
$this->conf['pidList'] = 1;
$res = $this->pi_exec_query($table,0,$addWhere,$mm_cat);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$items[] = $row;
}
debug($items)
Im Back-End geht das allerdings nicht, da pi_exec_query in die Klasse
tslib_pibase gehört. Das kann ich zwar umgehen mit den Zeilen:
require_once('C:/xampp/htdocs/t3421/typo3/sysext/cms/tslib/class.tslib_pibase.php');
....
$test = t3lib_div::makeInstance('tslib_pibase');
$res = $test->pi_exec_query($table,0,$addWhere,$mm_cat);
Doch dann kommt schon das nächste Problem:
Fatal error: Call to a member function enableFields() on a non-object in
C:\xampp\htdocs\t3421\typo3\sysext\cms\tslib\class.tslib_pibase.php on
line 1060
Hat jemand eine Idee, wie ich entweder die Funktion pi_exec_query im BE
nutzen kann, oder anderweitig aus einer DB-Tabelle alle Zeilen auslesen
kann, die zu einer bestimmten Kategorie gehören?
beste Grüße
Ron
More information about the TYPO3-german
mailing list