PHP notice

Trying to get property of non-object

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

322         ));
323     }
324     
325     /**
326      * jedan stan
327      * @param integer $apartment_id ID stana koji se prikazuje
328      */
329     public function actionApartment($apartment_id)
330     //public function actionApartment()
331     {
332         $type = 'APARTMENT';
333         $apartment = Apartment::model()->findByPk($apartment_id);
334         $comments = SNComment::model()->byTimeCreated()->findAllByAttributes(array('type'=>$type, 'type_id'=>$apartment->id));
335         $all_pictures = null;
336         if(!empty($apartment->gallery->image))
337         {
338             $all_pictures = $apartment->gallery->image;
339         }
340         
341         $rooms_coordinates = array();
342         if(!empty($apartment->rooms))
343         {
344         foreach($apartment->rooms as $room)
345         {
346             $temp_array = array();

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 05:57:23 Apache/2.2.15 (CentOS) Yii Framework/1.1.14