PHP notice

Trying to get property of non-object

/home/kam24gr/public_html/protected/components/PageViewController.php(100)

088         $model = null;
089         //drugs
090         $prefix = Yii::app()->config->get('prefix.drug');
091         if($model === null && ($prefix  == '' or preg_match('@^/'.$prefix.'/@', $uri))) {
092 
093             $id = Drugs::findByLSlug($slug, $lang);
094             if($id){
095                 $model=Drugs::model()->findByPk($id);
096                 
097                 //chk refer price
098                 if (isset($refer_prices[$id])) {
099                     $refer_model = Drugs::model()->findByPk($refer_prices[$id]['id']);
100                     $products = $refer_model->products;
101                     $temp = array();
102                     foreach ($products as $product) {
103                         if (in_array($product->dose, $refer_prices[$id]['dose'])) {
104                             array_push($temp, $product);
105                         }
106                     }
107                     $model->products = $temp;
108                 }
109 
110                 if($model->active == 0){
111                     throw new CHttpException(404,'The requested page does not exist.');
112                 }

Stack Trace

#0
+
 /home/kam24gr/public_html/protected/components/PageViewController.php(16): PageViewController->loadModelBySlug("vigora")
11         if(preg_match('@^_@', $slug)){
12             throw new CHttpException(404,'The requested page does not exist.');
13         }
14 
15 
16         $model = $this->loadModelBySlug($slug);
17 
18         $domain = $this->domain;
19 
20         $this->pageTitle = $model->title;
21         $this->keywords = $model->keywords;
#15
+
 /home/kam24gr/public_html/index.php(54): CApplication->run()
49 
50 // change the following paths if necessary
51 $yii=dirname(__FILE__).'/framework/yii.php';
52 
53 require_once($yii);
54 Yii::createWebApplication($config)->run();
2024-03-29 05:19:38 Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips Yii Framework/1.1.14