I am a little bit confused right now...in the CakePHP documentation, it states that PHP's visibility can be replaced as follows: private with __ and protected with _. But doing the necessary replacements, and calling a private method from within another class leads to the execution of that method without any restriction. What am I missing?
If you're setting them in the model, just use private and protected, the _ and __ only work for controller actions
the underscore is only effective for controller method, since the user can't access it. Inside Cake app, it's really just a convention. Besides I don't think it's a problem: You only need to lock your house from outside, you don't need to lock every doors if you are the only one in it. If you want to achieve that use private and protected PHP keywords.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With