Exemplo n.º 1
0
 /**
  * Sets sorting of whole album to given sorting parameter with given sorting direction
  *
  * @param Tx_Yag_Domain_Model_Album $album
  * @param string $sortingField
  * @param int $sortingDirection (1 = ASC, -1 = DESC)
  * @rbacNeedsAccess
  * @rbacObject album
  * @rbacAction update
  * @return void
  */
 public function updateSortingAction(Tx_Yag_Domain_Model_Album $album, $sortingField, $sortingDirection)
 {
     $direction = $sortingDirection == 1 ? \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING : \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING;
     $album->updateSorting($sortingField, $direction);
     $this->albumRepository->update($album);
     $this->addFlashMessage(LocalizationUtility::translate('tx_yag_controller_album.sortingChanged', $this->extensionName), '', FlashMessage::OK);
     $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager')->persistAll();
     $this->forward('list', 'ItemList');
 }