PHP notice

Trying to get property of non-object

/mnt/storage/setnekretnine/protected/controllers/ObjectController.php(17)

05 class ObjectController extends SIMAController
06 {
07 
08     /**
09      * mapa sa zgradom
10      * @param type $building_id
11      */
12     public function actionMap($building_id)
13     {
14         $building = Building::model()->findByPk($building_id);
15         $all_basis = BasisGoogleMap::model()->findAll();
16         $header = $this->renderPartial('header',array(
17             'building_name' => $building->name,
18             'build_id' => $building_id,
19             'city_name' => $building->city->DisplayName,
20             'active_page' => 'object/map',
21             'model' =>$building
22            
23         ),true);
24         $this->render('map', array(
25             'header' => $header,
26             'model'=>$building,
27             'all_basis' => $all_basis
28         ));
29     }

Stack Trace

#14
+
 /mnt/storage/setnekretnine/index.php(24): CApplication->run()
19 // specify how many levels of call stack should be shown in each log message
20 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
21 
22 require_once($yii);
23 
24 Yii::createWebApplication($config)->run();
25 
26 // Yii::app()->session['aaaa']=1;
27 // if (isset(Yii::app()->session['aaaa'])) Yii::app()->session['aaaa']=Yii::app()->session['aaaa']+1;
28 // else Yii::app()->session['aaaa']=1;
29 // echo Yii::app()->session['aaaa'];
2024-03-19 06:35:18 Apache/2.2.15 (CentOS) Yii Framework/1.1.14