/**
  * @return \yii\db\ActiveQuery
  */
 public function getSubCategories()
 {
     return $this->hasMany(SubCategory::className(), ['category_id' => 'category_id']);
 }
 public function getSpecificAttributes($sub_category_id)
 {
     return SubCategory::findBySql('select sub_category_specificattribute from sub_category where sub_category_id=' . $sub_category_id)->one();
 }
 public function actionSelectnumberofcolors($super_cat_id, $cat_id)
 {
     $session = new Session();
     $session->open();
     $superCategoryData = $session['superCategoryArray'];
     $super_cat_model = new SuperCategory(['super_category_id' => $super_cat_id]);
     $categoryData = $session['categoryData'];
     $showCategory = true;
     $category_model = new Category(['category_id' => $cat_id]);
     $SubcategoryData = $session['SubcategoryData'];
     $showSubCategory = true;
     $SubCategory_model = new SubCategory();
     $showColorNumberSelection = false;
     $modelItem = new Item();
     $showColorSizeImageSelection = false;
     if ($SubCategory_model->load(Yii::$app->request->post())) {
         $showColorNumberSelection = true;
         $colorNumbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
         $session['colorNumbers'] = $colorNumbers;
         $mirrorValues = array(1, 2, 3, 4, 5);
         $session['mirrorValues'] = $mirrorValues;
     }
     return $this->render('uploaditem', ['superCategoryData' => $superCategoryData, 'super_cat_model' => $super_cat_model, 'category_model' => $category_model, 'categoryData' => $categoryData, 'showCategory' => $showCategory, 'showSubCategory' => $showSubCategory, 'SubcategoryData' => $SubcategoryData, 'SubCategory_model' => $SubCategory_model, 'showColorNumberSelection' => $showColorNumberSelection, 'modelItem' => $modelItem, 'colorNumbers' => $colorNumbers, 'mirrorValues' => $mirrorValues, 'showColorSizeImageSelection' => $showColorSizeImageSelection]);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getItemSubCategory()
 {
     return $this->hasOne(SubCategory::className(), ['sub_category_id' => 'item_sub_category_id']);
 }