Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » DOD - Odd behavior with function name same as class name

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

Page: 1 2
Go to End
Author Topic: 4085 Views
  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: DOD - Odd behavior with function name same as class name Link to this post

    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.

  • Mohamed
    Avatar
    Community Member
    4 Posts

    Re: DOD - Odd behavior with function name same as class name Link to this post

    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

    4085 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.