Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DOD - Odd behavior with function name same as class name


Go to End


10 Posts   7173 Views

Avatar
Hamish

Community Member, 712 Posts

30 March 2010 at 8:19am

Please read up on the difference between php5 and php4 constructor syntax, you should not use php4 constructors at all.

You should use onAfterWrite, not the object constructor.

Avatar
Mohamed

Community Member, 4 Posts

31 March 2010 at 12:19pm

I thought there is a way around it by using the same class name since I am trying to pass parameters to the constructor which was not allowing me when I used __construct() (sorry for not mentioning this earlier. I thought I could get away with using php4 constructors somehow!) as I tried using the Parent::__construct within the subclass before but it did not work for me.

Thank you Hamish and AJ.. Cheers :)

Go to Top