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/users/index.php(24): BasicFunctions::getUserLog("1", "88247", "0")
19                 <h4><i class="fa fa-clock-o"></i> Последние события</h4>
20                 <div class="well background-clouds">
21 
22                         <?php foreach ($activity as $item) {
23                             $item->date = BasicFunctions::trueDate($item->date);
24                             $whatToDo = BasicFunctions::getUserLog($item->what_to_do, $item->what_id, $item->extra);
25                             echo ''.$item->date.' <b>&raquo;</b> <b>'.$item->user.'</b> '.$whatToDo.'<br />';
26                         } ?>
27                         <?php if (empty($activity)) { ?>
28                             <p align="center"><h5>Действий пользователя не обнаружено</h5></p>
29                         <?php } ?>
#5
+
 /var/www/sites571/data/www/gigafootball.net/protected/controllers/UsersController.php(76): CController->render("index", array("activity" => array(UserLogs, UserLogs, UserLogs, UserLogs, ...)))
71             $criteria->limit = 100;
72             $activity = UserLogs::model()->findAll($criteria);
73         }
74 
75 
76         $this->render('index', array('activity' => $activity));
77     }
78 
79     public function actionUsersFav()
80     {
81         $this->pageTitle = 'Избранное пользователей';
#13
+
 /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 04:57:57 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 Yii Framework/1.1.13