PHP notice

Trying to get property of non-object

/home/activesites/coupon4savings/protected/modules/coupon/models/Coupon.php(439)

427 
428             // from relationship
429             //        $sql .= ' RIGHT JOIN `term_coupon` AS `s` ON (`c`.`id` = `s`.`coupon_id`)';
430             //        $sql .= ' RIGHT JOIN `term` AS `t` ON (`t`.`id` = `s`.`term_id`)';
431 
432             // check status
433             $sql .= ' WHERE `c`.`status` = \'' . Coupon::STATUS_ENABLE . '\'';
434 
435             // list by store
436             if ($list == 'store') {
437 
438                 // filter by relation store
439                 $sql .= ' AND (`c`.`store_id` = '.$object->id.')';
440             } 
441 
442             //        if ($list != 'home')
443             //            $sql .= ' OR `c`.`status` = \'' . Coupon::STATUS_UNRELIABLE . '\'';
444 
445             $sql .= ' GROUP BY `c`.`id`';
446 
447             // check order
448             if ($list == 'home') {
449                 $sql .= ' ORDER BY `c`.`id` DESC';
450             } else {
451                 $sql .= ' ORDER BY `c`.`sorder` DESC';

Stack Trace

#0
+
 /home/activesites/coupon4savings/protected/modules/coupon/controllers/public/CouponController.php(123): Coupon::getListFeed("store", null)
118             $object = Term::model()->findByAttributes(array('slug' => $slug));
119 
120 // check object id (store | category)
121         $objectId = ($object) ? $object->id : null;
122 
123         $coupons = Coupon::model()->getListFeed($list, $object);
124 
125         Yii::import('ext.feed.*');
126 
127         $feed = new EFeed();
128 
#10
+
 /home/activesites/coupon4savings/index.php(20): CApplication->run()
15 
16 require_once($yii);
17 require_once(ABS_PATH . '/protected/components/MegaAdsApplication.php');
18 
19 $app = new MegaAdsApplication($config);
20 $app->run();
2024-03-28 05:05:55 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.0.33 Yii Framework/1.1.13