[TYPO3-mvc] Repositories return empty Tx_Extbase_Persistence_QueryResults

Hauke Stange hstange at eheundjanneck.de
Mon Jul 18 10:56:02 CEST 2011


Hi Bastian.

> > Using my Repositories in some of my Controllers always gets me empty
> > Results. For example, the findAll() method should return a bunch of
> > entries in most cases but I don't even get an array containing something
> > but an object of 'Tx_Extbase_Persistence_QueryResult' whose
> > 'queryResult' property is empty.
> 
> Since version 1.3 Query::execute() does not actually transmit the query 
> to the database but instead returning a proxy object (the QueryResult). 
> See [1] for more details.

Thx for this hint. By replacing...

$filialen = $this->filialeRepository->findByFirma($firma);
if (is_array($filialen) && !empty($filialen)) {
    $hasFilialen = true;
}

...through...

$filialen = $this->filialeRepository->findByFirma($firma);
if ($filialen->count() > 0) {
    $hasFilialen = true;
}

...all is going well.

Regards,
Hauke



More information about the TYPO3-project-typo3v4mvc mailing list