Reputation: 5586
I have used object oriented more in java, where a private member cannot be accessed from outsite the class, protected extending access to child classes, default access extending access to packages and public to every class.
How does this work in PHP when using MVC frameworks( I am using CodeIgniter)? Does it mean all methods in models which I will be accessing from Controllers have to be public?
Upvotes: 0
Views: 496
Reputation: 60413
This isnt really CI specific... but yes. check out: http://www.php.net/manual/en/language.oop5.visibility.php for more info on php method/property visibility.
Upvotes: 1
Reputation: 53851
It means the same thing.
There are no friend classes in php, so you cant break private just because you are using a MVC pattern. Note this is true in Java as well.
Upvotes: 1