PHP notice

Trying to get property of non-object

/home2/ieccom/public_html/protected/controllers/ProductsController.php(62)

50      */
51     public function actionView($id)
52     {
53         Yii::app()->theme = 'iec';
54         $this->layout = '//layouts/column2';
55         $model = $this->loadModel($id);
56         $brand = $model->brand_id;
57 
58         /**
59          * load brand
60          */
61         $brandModel = Brands::model()->findByPk($brand);
62         if($brandModel->themes != '' && $brandModel->themes != Yii::app()->theme)
63         {
64             Yii::app()->theme=$brandModel->themes;
65         }
66         /**
67          * load accessories
68          */
69         $pAccessories = Accessories::model()->loadAccessories($id);
70 
71         /**
72          * load download
73          */
74         $pDownloads = Downloads::model()->loadDownloads($id);

Stack Trace

#14
+
 /home2/ieccom/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 19:10:38 Apache Yii Framework/1.1.10