I have a parent class:
Abstract Class Base {
function __construct($registry) {
// stuff
}
}
I then have at least 2 classes that extend that class
class Cms extends Base {
// a few functions here
}
and this one
class Index extends Base {
// a few functions here
}
For the CMS class, the user will need to be logged in. Session has already been initiated and I want to check that the user is logged in by using a session var. So what I'd like to do is:
class Cms extends Base {
function __construct()
{
// check the user session is valid
}
// a few functions here
}
but of course that will overwrite the parent construct class and everything it set. Is there a way to have a __construct() type method that can be defined in the child class?