class BaseController
{
protected $mObj;
public function __construct()
{
$this->mObj = new Base();
$this->mObj->setUid($_SESSION['uid'] ?? null);
}
}
class Base
{
protected $uid;
public function setUid($session_uid)
{
$this->uid = $session_uid;
}
}
class AppController extends BaseController
{
public function __construct()
{
$this->mObj = new App();
$this->mObj->getUid(); // NULL
}
}
class App extends Base
{
public function getUid()
{
return $this->uid;
}
}
Как получить значение $this->uid, оставив использование свойства $mObj без изменений?