PHP notice

Trying to get property of non-object

/var/www/uralstudent.ru/public_html/protected/controllers/GuestController.php(12)

01 <?php
02 
03 class GuestController extends ObjectController {
04 
05     public function actionList() {
06         $model = $this->createModel();
07 
08         $crit = $model->listCriteria();
09 
10         $lastModel = $this->model()->find($crit);
11 
12         $crit->compare('guest_id', '<>' . $lastModel->primaryKey);
13 
14         $dataProvider = new CActiveDataProvider(get_class($model), array(
15             'criteria' => $crit,
16             'pagination' => array(
17                 'pageSize' => $model->getPageSize(),
18             ),
19         ));
20 
21         $this->render('list', array('dataProvider' => $dataProvider, 'model' => $model, 'lastModel' => $lastModel));
22     }
23 
24     public function actionComment($id) {

Stack Trace

#12
+
 /var/www/uralstudent.ru/public_html/index.php(71): CApplication->run()
66 defined('YII_DEBUG') or define('YII_DEBUG',true);
67 // specify how many levels of call stack should be shown in each log message
68 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
69 
70 require_once($yii);
71 Yii::createWebApplication($config)->run(); 
2024-03-29 12:30:22 nginx/1.6.2 Yii Framework/1.1.13