Reputation: 3301
Doctrine documentation says you can use
public function construct() { ... }
as a construct function since __construct can't be overridden.
When I place it in my code and put a echo in it
public function construct() { echo "constructing..."; }
it isn't called during the construction of the object.
How is it supposed to be called or is there some fancy way of calling a function during (or just after) load time in PHP?
Upvotes: 1
Views: 810
Reputation: 17876
Just because there is no output it doesn't mean that the method is not called. Try a exit('constructing...');
instead.
By the way: Works fine here with Doctrine 1.1 :-)
Upvotes: 2