I have 2GB of RAM on my laptop, which is the max.  

Should I install 32 bit version or 64 bit version?


Question: CASTING attributes for Ordering on a Doctrine2 DQL Query
Answer: You should be able to add your own function to implement this feature.

The class would look something like this:

namespace MyProject\Query;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;

class CastAsInteger extends FunctionNode
{
    public $stringPrimary;

    public function getSql(SqlWalker $sqlWalker)
    {
        return 'CAST(' . $this-&gt;stringPrimary-&gt;dispatch($sqlWalker) . ' AS integer)';
    }

    public function parse(Parser $parser)
    {
        $parser-&gt;match(Lexer::T_IDENTIFIER);
        $parser-&gt;match(Lexer::T_OPEN_PARENTHESIS);

        $this-&gt;stringPrimary = $parser-&gt;StringPrimary();

        $parser-&gt;match(Lexer::T_CLOSE_PARENTHESIS);
    }
}


You'll need to register your function:

$config = $em-&gt;getConfiguration();
$config-&gt;addCustomNumericFunction('INT', 'MyProject\Query\CastAsInteger');


Then you can use it:

SELECT e, INT(e.id) AS HIDDEN orderId FROM Namespace\Bla\MyEntity e ORDER BY orderId


PS: By adding the HIDDEN keyword, the alias orderId won't be in the results (and is only used for ordering).