PHP Error

Trying to get property of non-object

/home/bkgkpftlhosting/public_html/sainthonore/protected/controllers/ProductController.php(70)

58          if($id>0){
59              $current_cat = CategoryProduct::model()->findByPk($id);
60              $categories = CategoryProduct::model()->findAll(
61                  [
62                      'condition'=>'status=1 AND parent_id = ' . $id ,
63                      'order'=>'position ASC'
64                  ]
65              );
66 
67              if(!$categories){
68                  $categories = CategoryProduct::model()->findAll(
69                      [
70                          'condition'=>'status=1 AND parent_id = ' . $current_cat->parent_id ,
71                          'order'=>'position ASC'
72                      ]
73                  );
74              }
75 
76              $cat_ids = CategoryProduct::model()->getCategoryChildrenIds($current_cat->id);
77              array_push($cat_ids,$current_cat->id);
78          }else{
79              $categories = CategoryProduct::model()->findAll(
80                  [
81                      'condition'=>'status=1 AND parent_id = ' . CategoryProduct::ROOT_ID,
82                      'order'=>'position ASC'

Stack Trace

#12
+
 /home/bkgkpftlhosting/public_html/sainthonore/index.php(27): CApplication->run()
22 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
23 
24 require_once($yii);
25 $app = Yii::createWebApplication($config);
26 
27 $app->run();
2024-03-29 02:20:37 LiteSpeed Yii Framework/1.1.8