Věděl by někdo ? prosím
presenter :
$user = $this->userModel->fetchOneBy(['id' => $this->getUser()->getId()]); $this->user->getIdentity()->setRoles([$user->role]);
chyba : `Fatal Error
Call to a member function getIdentity() on a non-object `
Co ti vypíše dump($this->user); ?
dump($this->user);
Šaman napsal(a): Co ti vypíše dump($this->user); ?
Šaman napsal(a):
NULL
$user = $this->userModel->fetchOneBy(['id' => $this->getUser()->getId()]); dump($user->role); exit; //$this->user->getIdentity()->setRoles([$user->role]);
vysledek : „guest“ (5)
Vyřešeno :)
$this->getUser()->getIdentity()->setRoles([$user->role]);