You are an ignorant and you are complaining against me.
Why?
Do you know what Doctrine does? No, then pick then code, analyze and and check HA-HA, this code is trash and is doing a lot of overhead code for no reason but sugar candy.
Numeric array:
$customer[1]="john";
However, it is hard to maintain.
so
$customer["user"]="john";
is sufficient.
However, we could use OOP
$customer->user="john"
Is more OOP
Also, we could use setter/getters
$customer->setUser("john");
So now it is OOP
Costs:
* Numeric 0.038 seconds
* Associative array 0.040 seconds.
* Object 0.087 seconds.
* Object using setter and getters 0.2116 seconds.
* Objects using setter/and getters magic methods 0.399 seconds.
The average programmer that uses OOP uses an associative array. Doctrine uses Object using setter and getters with magic methods and the performance is (only for the definition of the values) around 1000% slower.
Why?
PHP doesn't have a method to turn an associative array into a specific class. Java can!, C# can!, but PHP is unable, so it converts into the generic stdClass and this class must be convert (again) into another class and it costs a lot. However, since Doctrine relies on syntax sugar, then it stores internally the values and it uses magic methods for practically everything. It costs a lot too.
In a nutshell, YOU CAN'T write a fast code using doctrine.