Zum Inhalt springen

sql Funktion im Controller?

Erstellt am 28. Januar 2011 · 1 Antwort · letzte Antwort am 28. Januar 2011

Tags: Frage

skriptkiddie ·

Hallo Zusammen,

ich habe in meinem Controller eine Funktion erstellt, die auch durch den Link aufgerufen wird.
Jedoch bekomme ich folgenden Fehler:
Fatal error: Call to undefined method Tx_Inventory_Controller_InventoryController::createQuery() in

bei :$query = $this->createQuery();

An was kann das liegen?

Die Funktion sieht so aus:
public function testAction() {
$ref = t3lib_div::makeInstance('Tx_Inventory_Domain_Repository_ProductRepository');
$query = $this->createQuery();
}
und die class:

class Tx_Inventory_Controller_InventoryController extends Tx_Extbase_MVC_Controller_ActionController {

oder gehört die abfrage ins repository?
Wenn ja, wie wird das dann geregelt?

skriptkiddie ·

Gelöst:

Meine Function im Controller muss so aussehen:
public function testAction() {
$thickbox = t3lib_div::makeInstance('Tx_Inventory_Domain_Repository_ThickboxRepository');
$ref = $thickbox->createQuery();

}