DQL syntax to hide irrelevant values for the result

Code
<?php

use PHPSnippets\Db\Entity\Test;

$getResult = function($dql) use ($entityManager) {
    return 
$entityManager->createQuery($dql)
        ->
setMaxResults(5)
        ->
getResult();
};

// Regular DQL Query
$dql 'SELECT t, MOD(t.id, 2) as modulo FROM '.Test::class.' t
    ORDER BY modulo DESC'
;
dump($getResult($dql));

// DQL Query with HIDDEN for modulo alias
$dql 'SELECT t, MOD(t.id, 2) as HIDDEN modulo FROM '.Test::class.' t
    ORDER BY modulo DESC'
;
dump($getResult($dql));
Result
array:3 [
0 => array:2 [
0 => Test {#382
+id: 1
+name: "foo"
+creationDate: DateTime @1405849049 {#368
date: 2014-07-20 11:37:29.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#412
-snapshot: []
-owner: Test {#382}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#393
-elements: []
}
#initialized: false
}
}
"modulo" => "1"
]
1 => array:2 [
0 => Test {#407
+id: 3
+name: "bar"
+creationDate: DateTime @1406093238 {#403
date: 2014-07-23 07:27:18.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#405
-snapshot: []
-owner: Test {#407}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#413
-elements: []
}
#initialized: false
}
}
"modulo" => "1"
]
2 => array:2 [
0 => Test {#401
+id: 2
+name: "test"
+creationDate: DateTime @1405845622 {#408
date: 2014-07-20 10:40:22.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#415
-snapshot: []
-owner: Test {#401}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#416
-elements: []
}
#initialized: false
}
}
"modulo" => "0"
]
]

array:3 [
0 => Test {#382
+id: 1
+name: "foo"
+creationDate: DateTime @1405849049 {#368
date: 2014-07-20 11:37:29.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#412
-snapshot: []
-owner: Test {#382}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#393
-elements: []
}
#initialized: false
}
}
1 => Test {#407
+id: 3
+name: "bar"
+creationDate: DateTime @1406093238 {#403
date: 2014-07-23 07:27:18.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#405
-snapshot: []
-owner: Test {#407}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#413
-elements: []
}
#initialized: false
}
}
2 => Test {#401
+id: 2
+name: "test"
+creationDate: DateTime @1405845622 {#408
date: 2014-07-20 10:40:22.0 Europe/Berlin (+02:00)
}
+subTests: PersistentCollection {#415
-snapshot: []
-owner: Test {#401}
-association: array:15 [ …15]
-em: EntityManager {#342 …11}
-backRefFieldName: "test"
-typeClass: ClassMetadata {#364 …}
-isDirty: false
#collection: ArrayCollection {#416
-elements: []
}
#initialized: false
}
}
]
Used Versions
PHP 7.2, Zend 3.0, Symfony 4.0, Laravel 5.6, PHPUnit 6.5, Doctrine 2.8