[DDC-2470, DDC-2441] Use column name instead of alias to modify order by clause #332

Merged
merged 2 commits into from Jun 7, 2013

Projects

None yet

3 participants

@guilhermeblanco guilhermeblanco and 2 others commented on an outdated diff Jun 7, 2013
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
- $orderby = preg_replace('/ORDER\s+BY\s+([^\)]*)(.*)/', '$1', $orderby);
- $orderbyParts = explode(',', $orderby);
- $orderbyColumns = array();
-
- //Split ORDER BY into parts
- foreach ($orderbyParts as &$part) {
- $part = trim($part);
- if (preg_match('/(([^\s]*)\.)?([^\.\s]*)\s*(ASC|DESC)?/i', $part, $matches)) {
- $orderbyColumns[] = array(
- 'table' => empty($matches[2]) ? '[^\.\s]*' : $matches[2],
- 'column' => $matches[3],
- 'sort' => isset($matches[4]) ? $matches[4] : null
- );
- }
- }
+ if ( ! $limit > 0) {
@guilhermeblanco
guilhermeblanco Jun 7, 2013 Member

?! ! $limit > 0?

@beberlei
beberlei Jun 7, 2013 Member

ah yes this looks weird :)

@FabioBatSilva
FabioBatSilva Jun 7, 2013 Member

Sorry about that..
Should be better now.. ;)

@guilhermeblanco guilhermeblanco merged commit 5a8eedf into doctrine:master Jun 7, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment