Roch
Roch

Reputation: 22041

Magic functions and inheritance

I would like to know if it's possible to create a magic object that extends another magic object, (with PHP).

Upvotes: 3

Views: 1809

Answers (1)

brianreavis
brianreavis

Reputation: 11546

I'm not totally sure what you're asking... are you wanting to explicitly invoke the magic methods of the parent class? If so, you can use the class' parent reference:

class Object extends dbObj{
    // ...
    // this is what i'm assuming you're looking for:
    public function __call($method, $variables){
        return parent::__call($method, $variables);
    }
}

Upvotes: 7

Related Questions