PHP notice

Trying to get property of non-object

/var/www/vhosts/projeaktif.com.tr/public_html/protected/modules/urun/controllers/front/DefaultController.php(151)

139     $new_array = array("success"=>$success,"total"=>$total,"items"=>array());
140     foreach($work as $item){
141         $new_array["items"][] = array("title"=> $item->title,"body"=>$item->body,"image"=>$item->image);
142     }
143     echo json_encode($new_array);
144 
145 }
146 
147 function actionShow($id) {
148 
149 
150     $urun = Urun::model()->findByAttributes(array('slug' => $id));
151     $projeler = Urun::model()->findAllByAttributes(array('category_id' => $urun->category_id));
152 
153     $this->pageTitle = $urun->title;
154     if(!empty($urun->category->parent->parent->parent->title)) { $this->breadcrumbs[$urun->category->parent->parent->parent->title] = '/projeler/kategori/'.$urun->category->parent->parent->parent->slug; };
155     if(!empty($urun->category->parent->parent->title)) { $this->breadcrumbs[$urun->category->parent->parent->title] = '/projeler/kategori/'.$urun->category->parent->parent->slug; };
156     if(!empty($urun->category->parent->title)) { $this->breadcrumbs[$urun->category->parent->title] = '/projeler/kategori/'.$urun->category->parent->slug;};
157     $this->breadcrumbs[$urun->category->title] = '/projeler/kategori/'.$urun->category->slug;
158     $this->breadcrumbs[$urun->title] = $urun->slug;
159 
160     if(!$urun)
161         throw new CHttpException(404,'Yazı Bulunamadı');
162     $this->render('show', array(
163         'post' => $urun,

Stack Trace

#9
+
 /var/www/vhosts/projeaktif.com.tr/public_html/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
+
 /var/www/vhosts/projeaktif.com.tr/public_html/index.php(29): CComponent->__call("runEnd", array("front"))
24     }
25 
26 }
27 
28 $app = new WeberWebApp($config);
29 $app->runEnd('front');
30 
2024-03-28 15:27:32 Apache Yii Framework/1.1.13