PHP Error

Trying to get property of non-object

/home/c/cb69283/public_html/protected/modules/industries/models/Sectors.php(136)

124     }
125 
126     public function getRel($id, &$data=array()) {
127         $id = str_replace("--", "", $id);
128         $data[$id] = '';
129         $criteria = new CDbCriteria();
130         $criteria->addCondition('id=:id');
131         $criteria->params[':id'] = $id;
132         if (isset($_GET['lang']) && $_GET['lang']) {
133             $criteria->select = array('id','parent_id', 'title_' . $_GET['lang'] . ' as title');
134         }
135         $data[$id] = Sectors::model()->find($criteria);
136         if ($data[$id]->parent_id) {
137             $this->getRel($data[$id]->parent_id, $data);
138         }
139         return $data;
140     }
141     public function getGroup($parent = '=0', $namegroup = '', &$return = array()) {
142         $categories = Sectors::model()->findAll(array('condition' => "parent_id" . $parent, 'order' => 'sort,title'));
143         foreach ($categories as $category) {
144             $sub = Sectors::model()->count('parent_id=' . $category->id);
145             if ($sub > 0) {
146                 if ($namegroup){
147                     $return[] = array('id' => $category->id, 'title' => $category->title, 'group' => $namegroup);
148                 }

Stack Trace

#0
+
 /home/c/cb69283/public_html/protected/modules/catalog/controllers/DefaultController.php(38): Sectors->getRel("68")
33         else if (isset($_GET['industries']) && $_GET['industries'])
34         {
35             $block = array('left' => array('industries' => 1), 'right' => array('type' => 1, 'producers' => 1));
36             $render = 'views';
37             $action = 'industries';
38             $title = array_reverse(Sectors::model()->getRel($_GET['industries']));
39                         if (!empty($title))
40                         {
41                             $description = $title[0]->getField('seoReserved');
42                         }
43 //            if (isset($_GET['type']) && !Sectors::model()->findByPk($_GET['type'])->parent_id)
#8
+
 /home/c/cb69283/public_html/index.php(36): CApplication->run()
31         break;
32 }
33 ini_set('display_errors', 1);
34 ini_set('display_startup_errors', 1);
35 error_reporting(E_ALL);
36 Yii::createWebApplication($config)->run();
37 
38 
2024-03-15 08:35:20 Apache/2.4.29 Yii Framework/1.1.8