Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Classes/Persistence/QueryInterface.php b/Classes/Persistence/QueryInterface.php
- index 25f2dad..d89dc1f 100644
- --- a/Classes/Persistence/QueryInterface.php
- +++ b/Classes/Persistence/QueryInterface.php
- @@ -94,6 +94,7 @@ interface Tx_Extbase_Persistence_QueryInterface {
- */
- const ORDER_ASCENDING = 'ASC';
- const ORDER_DESCENDING = 'DESC';
- + const ORDER_RANDOM = 'RAND';
- /**
- * An inner join.
- diff --git a/Classes/Persistence/Storage/Typo3DbBackend.php b/Classes/Persistence/Storage/Typo3DbBackend.php
- index 3610b2d..2635464 100644
- --- a/Classes/Persistence/Storage/Typo3DbBackend.php
- +++ b/Classes/Persistence/Storage/Typo3DbBackend.php
- @@ -873,6 +873,8 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
- case Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING:
- $order = 'DESC';
- break;
- + case Tx_Extbase_Persistence_QueryInterface::ORDER_RANDOM:
- + $sql['orderings'] = array(' rand()');
- + continue;
- + break;
- default:
- throw new Tx_Extbase_Persistence_Exception_UnsupportedOrder('Unsupported order encountered.', 1242816074);
- }
Advertisement
Add Comment
Please, Sign In to add comment