Help guys to understand when the following error occurs.
$culture = $this->context->getUser()->getCulture(); //Выдает ошибку Call to a member function getCulture() on null //Пытаюсь решить следующим образом $user = $this->context->getUser(); if($user) $culture = $user->getCulture(); else $culture = 'ru'; //бесполезно :( $this->inst_details['name'] = $this->instrument->getName(); //Выдает ошибку Call to a member function getName() on boolean in ... It is interesting that this is a mistake I brought out of the logs. So I did not meet her. It seems to work. But there is some situation when these errors occur.
1) Call to a member function foo () on null | on boolean in which cases PHP gives such errors
2) in what cases in symfony 1.4 $ this-> context-> getUser () -> getCulture (); may produce this error.
Help please understand and solve this problem.