Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

6 votes
3 answers
5k views

How to prevent usage of public parent methods in child instance in PHP?

So let's say I have classes called parent and child, which will be then used from PHP file called caller.php class Child extends Parent { } class Parent { public function parentMethod(){ }...
Firze's user avatar
  • 4,019
1 vote
1 answer
2k views

Changing the visibility scope of parent methods in child classes

I've got a Validator class and a UserValidator class which extends from it. My Validator has a public method setRule(...) with public visibility. When I extend from it I want to change the ...
Kid Diamond's user avatar
  • 2,281
0 votes
1 answer
233 views

doctrine2 and codeigniter2, right approach for parent class to interact with child properties

I'm searching for this for quite some time now. I saw few similar questions but not sure if they apply with doctrine2 and this problem. I'm trying to get started with CodeIgniter2 and Doctrine2, and I'...
Dalibor's user avatar
  • 167