PHP warning

Attempt to read property "parentId" on null

/mnt/HC_Volume_23321257/focusextranet/public_html/catalogafaceri.ro/public_html/protected/controllers/MY_Front_ListController.php(274)

262     public function actionCategory()
263     {
264         $categoryId       = getValue( "cat" );
265         $countyId         = getValue( "county" );
266         $businessCategory = BusinessCategoryModel::model()->findByPk( $categoryId );
267         $subcategoryArray = array( $categoryId );
268         $page             = getValue( "page" );
269         if( empty( $page ) )
270         {
271             $page = 0;
272         }
273 
274         $advertCategory = $businessCategory->parentId;
275         if( $businessCategory->parentId == 0 )
276         {
277             $advertCategory = $categoryId;
278             $categoryName  = $businessCategory->name;
279             $subcategories = Yii::app()->db->createCommand()
280                 ->select( "id" )
281                 ->from( "business_categories" )
282                 ->where( array( "and", "countryId=1", "parentId=" . $categoryId ) )
283                 ->queryAll();
284 
285             if( !empty( $subcategories ) )
286             {

Stack Trace

#12
+
 /mnt/HC_Volume_23321257/focusextranet/public_html/catalogafaceri.ro/public_html/index.php(44): CApplication->run()
39 define( "LANGUAGE_PATH", BASE_PATH."protected/languages/" );
40 
41 date_default_timezone_set( "Europe/Bucharest" );
42 
43 require_once( $yii );
44 Yii::createWebApplication( $config )->run();
2024-03-28 12:43:02 Apache Yii Framework/1.1.10