Issue Bug Closed

#75163Extbase Repository Default Orderings and the lastUpdated Column

Karsten Beyer 03/17/16, 18:40 updated 04/18/16, 17:21

Description

In my project i have mapped the pages table to a local domain object in order to show for example related pages using a extbase plugin.

I would like to sort the results by the lastUpdated column, however this seems to be impossible with the extbase repository as it automatically converts the camelcase notation to an underscore form:

lastUpdated => last_updated

Which then results in an error…

This is the setting in the repository:

@class PageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {

@ protected $defaultOrderings = array(“lastUpdated”=> \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING );

and this the resulting exception:

#1247602160: Unknown column ‘pages.last_updated’ in ‘order clause’ (More information)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.