Page 1 of 1

Accessing other extended classes

Posted: Thu Jan 21, 2010 7:56 pm
by GeXus
I have a setup, where there's a base class, then several classes that extend off of it... Is it possible to access the extended classes within another?

So for example, class Products extends Base and class Users extends Base... I want to access a function within the Users class within the Products class.....

Thanks!

Re: Accessing other extended classes

Posted: Thu Jan 21, 2010 9:28 pm
by Hieroglyphics
No it is not possible but what you CAN do is.

Code: Select all

private $this->users;
 
public function __construct() {
    include_once('filethatcontainsusersclass.php');
    $this->users = new Users();
}
Then use like $this->users->functionfromusers()

Re: Accessing other extended classes

Posted: Thu Jan 21, 2010 11:05 pm
by GeXus
Gotcha.. thanks! :)