从另一个扩展调用extbase查询函数

时间:2013-02-20 20:43:20

标签: typo3 extbase

我使用以下存储库获得了一个基于TYPO3的基于扩展的扩展:

public function findSomething() {              
    $query = $this->createQuery();
    $results = $query->execute();     
    return $results;
}

通话来自同一个分机。不,我获得了第二个扩展,我实现了第一个扩展:

$repo = t3lib_div::makeInstance('the_first_Repository');
$item = $repo->findSomething();

但是Repository没有返回任何内容(type =具有大量无用数据的对象)。不,我重写了Repository中的findSomething()函数以使用旧式的DBAL Layer:

public function findSomething() {    
    $items = array();        
    $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','some_table');
    while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
        $items[] = $row;
    }
    return $items;
}

哪个有效。我要从第二个扩展中使用基于extbase的查询框架做什么?!

1 个答案:

答案 0 :(得分:2)

确定。典型的8个多小时的编程问题-.- 我忘了为第一个扩展名的对象添加persistence.storagePid

相关问题