Created
November 20, 2012 09:52
-
-
Save awartoft/4117037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Antoine Hedgecock <[email protected]> | |
* @author Jonas Eriksson <[email protected]> | |
* | |
* @copyright PMG Media Group AB | |
*/ | |
namespace Domain\Repository\SqlWalker; | |
use Doctrine\ORM\Query\SqlWalker; | |
/** | |
* @category Domain | |
* @package Repository | |
* @subpackage SqlWalker | |
*/ | |
class OrderByCollate extends SqlWalker | |
{ | |
public function walkOrderByItem($item) | |
{ | |
$sql = parent::walkOrderByItem($item); | |
if ($item->expression->field == 'name' && $item->expression->identificationVariable == 'domain') { | |
$sql = str_replace(' ', ' COLLATE utf8_swedish_ci ', $sql); | |
} | |
return $sql; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment