/** * Creates a new Supplier model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Supplier(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $product = Yii::$app->session->get(Product::className()); if ($product) { return $this->redirect(['product/create']); } return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
/** * @return \yii\db\ActiveQuery */ public function getProducts0() { return $this->hasMany(Product::className(), ['updated_by' => 'updated_by']); }
public function getProducts() { return $this->hasMany(Product::className(), ['id_history' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProduct() { return $this->hasOne(Product::className(), ['id' => 'product_id']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['section_id' => 'id_section']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'productId'])->viaTable('product_has_loyalty', ['loyaltyId' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getItem() { return $this->hasOne(Product::className(), ['item_id' => 'item_id']); }
public function getProducts() { return $this->hasMany(Product::className(), ['category_id' => 'id']); }
/** * Interface for many-to-many relationship * @return ActiveRecord */ public function getLinkedProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('products_groups', ['group_id' => 'id']); }
/** * Override gallery api actions to remove the deleted image ids from the * estimate entries. * @param string $action * @return mixed */ public function actionGalleryApi($action) { if ($action == 'delete') { $ids = Yii::$app->request->post('id'); $entries = EstimateEntry::find()->where(['product_image_id' => $ids])->all(); foreach ($entries as $entry) { $entry->product_image_id = null; $entry->save(); } } $apiActionCofing = ['class' => GalleryManagerAction::className(), 'types' => [Product::GALLERY_IMAGE_TYPE => Product::className()]]; $apiAction = Yii::createObject($apiActionCofing, ['gallery-api', $this]); return $apiAction->run($action); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['subcategory_id' => 'id'])->where('status="ACTIVE" AND auction="NO"'); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('stockin_detail', ['stockin_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['supplier_id' => 'id']); }
/** * @return ProductQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['SupplierID' => 'SupplierID'])->inverseOf('supplier'); }
public function getProducts() { return $this->hasMany(Product::className(), ['goods_id' => 'goods_id'])->asArray(); }
/** * @return ProductQuery */ public function getProduct() { return $this->hasOne(Product::className(), ['ProductID' => 'ProductID'])->inverseOf('orderDetails'); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'productId'])->viaTable('check_has_product', ['checkId' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('productscart', ['cart_id' => 'id']); }
public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('product_characteristic', ['characteristic_id' => 'id']); }
public function getRefProduct() { return $this->hasOne(Product::className(), ['barcode' => 'ref_product_id']); }
/** * @return ProductQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['ProductID' => 'ProductID'])->viaTable('OrderDetails', ['OrderID' => 'OrderID']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable(self::menu2ProductTableName(), ['menu_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['type_product_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable(self::diary2productsTableName(), ['diary_id' => 'id']); }
public function getProducts() { return $this->hasMany(Product::className(), ['line_id' => 'id'])->andOnCondition(['status' => 'ACTIVE']); }
/** * @return \yii\db\ActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['provider' => 'id']); }
/** * @return ProductQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['CategoryID' => 'CategoryID'])->inverseOf('category'); }