PHP notice

Trying to get property of non-object

/var/www/sticker-bk.ru/data/www/sticker-bk.ru/protected/controllers/SiteController.php(208)

196 
197         if (!$category) {
198             Yii::app()->runController($_GET['view']);
199         } else {*/
200         $pageLimit = Yii::app()->request->getParam('per-page', 15);
201 
202         $criteria = $this->criteria();
203 
204         if(isset($_GET['id'])) {
205 
206             $category = Categories::model()->findByPk($_GET['id']);
207             $categories = array();
208             $cats = array( $category->id );
209             $descendants = $category->descendants()->findAll(array('order' => 't.lft'));
210             foreach( $descendants as $oCategory ) {
211                 if( !isset( $categories[$oCategory->parent] ) ){
212                     $categories[$oCategory->parent] = array();
213                 }
214                 $categories[$oCategory->parent][] = $oCategory;
215                 $cats[] = $oCategory->id;
216             }
217 
218             $criteria->addCondition("category regexp '[[:<:]](" . implode('|', $cats) . ")[[:>:]]'");
219             foreach ($category->ancestors()->findAll() as $cat) {
220                 if (!$cat->isRoot()) {

Stack Trace

#12
+
 /var/www/sticker-bk.ru/data/www/sticker-bk.ru/index.php(13): CApplication->run()
08 
09 defined('YII_DEBUG') or define('YII_DEBUG', true);
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', $environment->getTraceLevel());
11 
12 require_once($yii);
13 Yii::createWebApplication($environment->getConfig())->run();
2024-03-29 16:46:23 Apache/2.4.10 (Debian) Yii Framework/1.1.15