PHP notice

Trying to get property 'id' of non-object

/home/u5489196/public_html/ar/protected/modules/urunler/controllers/front/DefaultController.php(43)

31         foreach ($asd as $key) {
32             //
33             $model = UrunKategori::model()->findByPk($key->id);
34             $model->save();
35             echo $key->title.'--'.$key->slug.'<br>';
36         }
37     }
38 
39     function actionKategori ($slug) {
40         $this->layout="//layouts/contentpages";
41         $cat = UrunKategori::model()->findByAttributes(array('slug'=>$slug));
42 
43         $subcheck = UrunKategori::model()->findAllByAttributes(array('parent_id'=>$cat->id));
44 
45         if (count($subcheck) < 1){
46             $this->layout="//layouts/fullwidth";
47         } 
48 
49         $this->pageTitle = $cat->title;
50         $this->breadcrumbs[Yii::t('urunlerModule.front','moduletitle')] = '#';
51         $this->breadcrumbs[$cat->title] = Yii::app()->baseUrl . '/urunler/kategori/'.$cat->slug;
52 
53         
54         $criteria = new CDbCriteria();
55         $criteria->condition = 'FIND_IN_SET(:id,category_id)';

Stack Trace

#9
+
 /home/u5489196/public_html/ar/protected/components/WebApplicationEndBehavior.php(32): CApplication->run()
27         // Attach the changeModulePaths event handler
28         // and raise it.
29         $this->onModuleCreate = array($this, 'changeModulePaths');
30         $this->onModuleCreate(new CEvent($this->owner));
31 
32         $this->owner->run(); // Run application.
33     }
34 
35     // This event should be raised when CWebApplication
36     // or CWebModule instances are being initialized.
37     public function onModuleCreate($event)
#11
+
 /home/u5489196/public_html/ar/index.php(22): CComponent->__call("runEnd", array("front"))
17         return parent::init();
18     }
19 }
20 
21 $app = new kraftCMS($config);
22 $app->runEnd('front');
23 
2024-03-29 13:04:05 LiteSpeed Yii Framework/1.1.20