448191 Posted February 11, 2008 Share Posted February 11, 2008 Fatal error: Call to private Backbone_Data_TransferObject_Abstract::__construct() from context 'Backbone_Data_TransferObject_Abstract' in J:\John\Sites\Library\Backbone\Data\TransferObject\Abstract.lib on line 12 Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/ Share on other sites More sharing options...
Daniel0 Posted February 11, 2008 Share Posted February 11, 2008 Super Private! Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464117 Share on other sites More sharing options...
448191 Posted February 11, 2008 Author Share Posted February 11, 2008 Already found the cause, I was being stupid. Although you have to admit, that message confuses the hell out of you if don't know what's causing it. Basically I have this supertype, with a private constructor (stupid stupid stupid) and a factory method. The factory method has access to the supertype's constructor, but the subtype does not and can not inherit it, since it is private. Since we never left the scope of the supertype, we end up with this peculiar, but correct, error message. Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464134 Share on other sites More sharing options...
GameYin Posted February 11, 2008 Share Posted February 11, 2008 ??? :'( ALL at once Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464206 Share on other sites More sharing options...
neylitalo Posted February 11, 2008 Share Posted February 11, 2008 Is there ever a situation where you'd want to make a constructor private? Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464249 Share on other sites More sharing options...
Daniel0 Posted February 11, 2008 Share Posted February 11, 2008 Is there ever a situation where you'd want to make a constructor private? For instance if you are creating a singleton and wish to restrict instantiation. In that way you can ensure that it will only be instantiated from within the class. Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464254 Share on other sites More sharing options...
neylitalo Posted February 11, 2008 Share Posted February 11, 2008 Ah, yes. And then have a getInstance method to handle the first instantiation, right? Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464260 Share on other sites More sharing options...
Daniel0 Posted February 11, 2008 Share Posted February 11, 2008 Yes, the first and only instantiation. Link to comment https://forums.phpfreaks.com/topic/90524-are-you-kidding-me/#findComment-464263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.