[TYPO3-mvc] Unsure if i spotted a bug

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Jan 3 16:07:00 CET 2011


Hey Sebastian,

> looking into the Tx_Extbase_Persistence_QueryResult class i have seen
> something that worries my a little.
...
> $query = clone $this->query;
> $query->setLimit(1);
> $queryResult = $this->dataMapper->map($this->query->getType(),
> $this->persistenceManager->getObjectDataByQuery($this->query));
...
> If i understand it right, target is to have a query with limit one in
> $query. But this object isnt used when it comes to mapping, or is it my
> misunderstanding? Wouldn't it be a better solution to use:
>
> $this->dataMapper->map($query->getType(),
> $this->persistenceManager->getObjectDataByQuery($query));

from what you're posting here I'd say this is a "bug". What sense does 
it have to clone and configure the query object and then don't use it. 
Please file a bugreport and I'll take care of it after having talked to 
Bastian what his main intention here was. But in my eyes using a query 
with limit here absolutely makes sense performance wise.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list