Welcome to the Treehouse Community
Looking to learn something new?
Konrad Pilch2,435 Points
WHen do we exactly use :: ?
When exactly do we use
So for example
static::$db_table //and User::find_all();
When exactly we need to use the :: ? and not for example $this-> or other sutff?
Nathaniel Kolenberg12,836 Points
I asked the question as well to a developer at some point and they explained to me that sometimes you have functions defined as private in your Parent class, that you don't want to pass on to the instantiated Child objects. In that case, if you still want to use the private function, you would use Parent::function().
But in all honesty, I've not yet used this kind of method myself apart from using PDO functions such as PDO::PARAM_STR.