Snippets

This Mächler TYPO3 Extbase Repository - default orderings, limit query

Created by This Mächler
/**
* The repository for Entries
*/
class EntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {

	protected $defaultOrderings = array(
			'crdate' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING,
			'lastname' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
			'firstname' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
		);	
		
	public function findAllLimited( $offset, $limit ){
		$query = $this->createQuery();
		return $query
			->setOffset( $offset )
			->setLimit( $limit )
			->execute();
	}

	public function persistAll(){
		$this->persistenceManager->persistAll();
	}
	
}

Comments (1)

  1. Linda Melson
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.