PHP notice

Trying to get property of non-object

/var/www/sites571/data/www/gigafootball.net/protected/models/BasicFunctions.php(577)

565      * User logs
566      * @param $whatDo
567      * @param $whatId
568      * @param $whatExtra
569      * @return string
570      */
571     public static function getUserLog ($whatDo, $whatId, $whatExtra)
572     {
573 
574         if ($whatDo == 1) {
575             $news = News::model()->findByPk($whatId);
576 
577             return 'комментирует новость <a href="http://gigafootball.net/news/'.$news->id.'">'.CHtml::encode($news->title).'</a>';
578         }
579         if ($whatDo == 2) {
580 
581             return 'делает запись на <a href="http://gigafootball.net/stena/">стене сайта</a>';
582         }
583         if ($whatDo == 3) {
584             $news = News::model()->findByPk($whatId);
585 
586             return 'оценивает новость <a href="http://gigafootball.net/news/'.$news->id.'">'.CHtml::encode($news->title).'</a>';
587         }
588         if ($whatDo == 4) {
589             if ($whatExtra == 1) {

Stack Trace

#0
+
 /var/www/sites571/data/www/gigafootball.net/protected/views/my/index.php(111): BasicFunctions::getUserLog("1", "85395", "0")
106 
107                     <div class="well background-clouds">
108 
109                             <?php foreach ($activity as $item) {
110                                 $item->date = BasicFunctions::trueDate($item->date);
111                                 $whatToDo = BasicFunctions::getUserLog($item->what_to_do, $item->what_id, $item->extra);
112                                 echo ''.$item->date.' <b>&raquo;</b> <b>'.$item->user.'</b> '.$whatToDo.'<br />';
113                             } ?>
114                             <?php if (empty($activity)) { ?>
115                                 <p align="center"><h5>Действий пользователя не обнаружено</h5></p>
116                             <?php } ?>
#5
+
 /var/www/sites571/data/www/gigafootball.net/protected/controllers/MyController.php(16): CController->render("index", array("user" => Users))
11         if ($user) {
12             $this->pageTitle = $name;
13             Yii::app()->params->desc = 'Профиль пользователя '.$name.' на GIGAfootball.Net.';
14             Yii::app()->params->keys = $name.', профиль, юзер, профиль пользователя, профиль юзера';
15 
16             $this->render('index', array('user' => $user));
17         }else{
18             $this->redirect(Yii::app()->request->baseUrl.'/site/error/');
19             exit;
20         }
21     }
#15
+
 /var/www/sites571/data/www/gigafootball.net/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-19 11:06:29 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 Yii Framework/1.1.13