[TYPO3-ttnews] Extend news - Access news Repository from inside your own extension

Thomas Meixner tom.meixner at gmail.com
Mon Jul 9 14:00:38 CEST 2012


Hello,

I have followed the instructions in the wiki to extend the news records by 
some new fields (including a new m:m relation)

In my own extension I now need to query the news Repository (to e.G. list by 
author). I have tried various methods all of which result in an empty 
Tx_Extbase_Persistence_QueryResultprototype object.

The same code which works inside the news extension, e.G. in the action 
Controller doesn't produce results in my extension. I'm using the 
objectManager instead of the DI method here but the results are the same.

public function listAction() {

	$this->newsRepository = $this->objectManager-
>get('Tx_News_Domain_Repository_NewsRepository');
	$newsRecords = $this->newsRepository->findAll();
	Tx_Extbase_Utility_Debugger::var_dump($newsRecords);
}

I verified the storage PIDs so I don't think this is the error:

plugin.tx_ainesnews.persistence.storagePid = 32, 36, 26
plugin.tx_news.persistence.storagePid = 32, 36, 26
config.tx_extbase.persistence.classes.Tx_News_Domain_Repository_NewsRepository.newRecordStoragePid 
= 32, 36, 26

Any idea why the repository doesn't return any objects inside my own 
extension?


Thanks in advance for any help,

Thomas


More information about the TYPO3-project-tt-news mailing list