Accessing methods of a base class

4 posts

Flag Post


Basically, I have a class with a couple of methods in it, and I have a second class which extends it.

I’m trying to access a method that’s in the base class within the second class file, and whenever I try to compile, it throws an error my way.

Call to a possibly undefined method stillOnPlatform.

As a last resort, I could override the functions I need into the file, but it might be nice to see where I’m going wrong nonetheless.

Thank in advance. :D

Flag Post

In the base class use protected not private

Flag Post

Ah, I gotcha.

I’ve always wondered what protected did…

Thanks. :D

Flag Post

Remember, though, that private components are still extended and effectual, you just can’t reference them.