[TYPO3-mvc] own sorting with extbase

Stephan Schuler Stephan.Schuler at netlogix.de
Sat Jan 25 00:34:54 CET 2014


Hey there.


This seems to be a great source of misunderstanding.

Have a look at this thread:
http://forum.typo3.org/index.php?t=msg&th=201242&goto=702136&#msg_702136

I know that the question asked doesn't complete match your question. But I know for sure that the misunderstanding there is exactly what you're doing.

The thing is: You cannot manually adjust the content of a query result. I know you think you can, you most likely think about a query result as just something like a wrapper of an array. But be assured, there is a lot more.


Regards,


Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de



--
netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



________________________________________
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [typo3-project-typo3v4mvc-bounces at lists.typo3.org]" im Auftrag von "Alexander Averbukh [alav at gmx.net]
Gesendet: Freitag, 24. Januar 2014 14:50
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] own sorting with extbase

no, I need no array, but on object of Tx_Extbase_Persistence_QueryResultInterface

if I do:

$sorting = array('3', '1', '2', '7', '8', '5')
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->matching($query->in('uid', $sorting));
$results = $query->execute();

$sorted = mySortFunction($results->toArray());

return $sorted:

I get the follow exception:

#1: PHP Catchable Fatal Error: Argument 1 passed to Tx_News_ViewHelpers_Widget_PaginateViewHelper::render() must implement interface TYPO3\CMS\Extbase\Persistence\QueryResultInterface, array given in D:\xampp\htdocs\t3\typo3conf\ext\news\Classes\ViewHelpers\Widget\PaginateViewHelper.php line 66
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list