[TYPO3-german] pi_exec_query in Backend TCA

Christopher Schnell typo3 at mda.ch
Fri Jul 11 10:39:25 CEST 2008


Hallo Ronald,

ich kann dir nur die Lektüre der TCA Deku ans Herz legen:
Generell: 
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/current/view/
Speziell vielleicht zu deinem Problem: 
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/4/2/#id4230585

Falls du es gerne weniger Abstrakt und auf deutsch hast, kann ich das 
Profihandbuch von Ripfel empfehlen, da steht einiges zum TCA drin,

Gruss,
Christopher.

Dr. Ronald P. Steiner schrieb:
> 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
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
>
>   



More information about the TYPO3-german mailing list