Skip to content

Commit

Permalink
obsolete method createOrderingsFromDemand removed (is implemented in …
Browse files Browse the repository at this point in the history
…parent class already)
  • Loading branch information
dwenzel committed Jul 26, 2014
1 parent cbc8e57 commit 66bdfb8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
32 changes: 0 additions & 32 deletions Classes/Domain/Repository/PositionTypeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,6 @@ protected function createConstraintsFromDemand (\TYPO3\CMS\Extbase\Persistence\Q
return $constraints;
}

/**
* Returns an array of orderings created from a given demand object.
*
* @param \Webfox\Placements\Domain\Model\Dto\DemandInterface $demand
* @return \array<\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Constraint>
*/
protected function createOrderingsFromDemand(\Webfox\Placements\Domain\Model\Dto\DemandInterface $demand) {
$orderings = array();

//@todo validate order (orderAllowed)
if ($demand->getOrder()) {
$orderList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $demand->getOrder(), TRUE);

if (!empty($orderList)) {
// go through every order statement
foreach ($orderList as $orderItem) {
list($orderField, $ascDesc) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('|', $orderItem, TRUE);
// count == 1 means that no direction is given
if ($ascDesc) {
$orderings[$orderField] = ((strtolower($ascDesc) == 'desc') ?
\TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING :
\TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING);
} else {
$orderings[$orderField] = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING;
}
}
}
}

return $orderings;
}

}
?>

33 changes: 0 additions & 33 deletions Classes/Domain/Repository/WorkingHoursRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,39 +46,6 @@ protected function createConstraintsFromDemand (\TYPO3\CMS\Extbase\Persistence\Q
$constraints = array();
return $constraints;
}

/**
* Returns an array of orderings created from a given demand object.
*
* @param \Webfox\Placements\Domain\Model\Dto\DemandInterface $demand
* @return \array<\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Constraint>
*/
protected function createOrderingsFromDemand(\Webfox\Placements\Domain\Model\Dto\DemandInterface $demand) {
$orderings = array();

//@todo validate order (orderAllowed)
if ($demand->getOrder()) {
$orderList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $demand->getOrder(), TRUE);

if (!empty($orderList)) {
// go through every order statement
foreach ($orderList as $orderItem) {
list($orderField, $ascDesc) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('|', $orderItem, TRUE);
// count == 1 means that no direction is given
if ($ascDesc) {
$orderings[$orderField] = ((strtolower($ascDesc) == 'desc') ?
\TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING :
\TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING);
} else {
$orderings[$orderField] = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING;
}
}
}
}

return $orderings;
}

}
?>

0 comments on commit 66bdfb8

Please sign in to comment.