當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Product::className方法代碼示例

本文整理匯總了PHP中app\models\Product::className方法的典型用法代碼示例。如果您正苦於以下問題:PHP Product::className方法的具體用法?PHP Product::className怎麽用?PHP Product::className使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Product的用法示例。


在下文中一共展示了Product::className方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionCreate

 /**
  * 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]);
     }
 }
開發者ID:stupidusername,項目名稱:bukmark,代碼行數:18,代碼來源:SupplierController.php

示例2: getProducts0

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProducts0()
 {
     return $this->hasMany(Product::className(), ['updated_by' => 'updated_by']);
 }
開發者ID:swapnilfarande,項目名稱:ProductManager,代碼行數:7,代碼來源:User.php

示例3: getProducts

 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['id_history' => 'id']);
 }
開發者ID:pyvil,項目名稱:test-task-sb,代碼行數:4,代碼來源:History.php

示例4: getProduct

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProduct()
 {
     return $this->hasOne(Product::className(), ['id' => 'product_id']);
 }
開發者ID:frankpaul142,項目名稱:mosaico,代碼行數:7,代碼來源:Auction.php

示例5: getProducts

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['section_id' => 'id_section']);
 }
開發者ID:highestgoodlikewater,項目名稱:diplom,代碼行數:7,代碼來源:Section.php

示例6: getProducts

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['id' => 'productId'])->viaTable('product_has_loyalty', ['loyaltyId' => 'id']);
 }
開發者ID:index0h,項目名稱:innovecs-test.pro,代碼行數:7,代碼來源:Loyalty.php

示例7: getItem

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getItem()
 {
     return $this->hasOne(Product::className(), ['item_id' => 'item_id']);
 }
開發者ID:asopin,項目名稱:shop,代碼行數:7,代碼來源:Baskets.php

示例8: getLinkedProducts

 /**
  * 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']);
 }
開發者ID:secondsano,項目名稱:mebel,代碼行數:8,代碼來源:Group.php

示例9: actionGalleryApi

 /**
  * 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);
 }
開發者ID:stupidusername,項目名稱:bukmark,代碼行數:20,代碼來源:ProductController.php

示例10: getProducts

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['subcategory_id' => 'id'])->where('status="ACTIVE" AND auction="NO"');
 }
開發者ID:frankpaul142,項目名稱:mosaico,代碼行數:7,代碼來源:Subcategory.php

示例11: getProducts

 /**
  * @return ProductQuery
  */
 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['SupplierID' => 'SupplierID'])->inverseOf('supplier');
 }
開發者ID:netis-pl,項目名稱:yii2-crud-demo,代碼行數:7,代碼來源:Supplier.php

示例12: getProducts

 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['goods_id' => 'goods_id'])->asArray();
 }
開發者ID:xingfuunit,項目名稱:pzfresh,代碼行數:4,代碼來源:Goods.php

示例13: getProduct

 /**
  * @return ProductQuery
  */
 public function getProduct()
 {
     return $this->hasOne(Product::className(), ['ProductID' => 'ProductID'])->inverseOf('orderDetails');
 }
開發者ID:netis-pl,項目名稱:yii2-crud-demo,代碼行數:7,代碼來源:OrderDetail.php

示例14: getProducts

 public function getProducts()
 {
     return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('product_characteristic', ['characteristic_id' => 'id']);
 }
開發者ID:frankpaul142,項目名稱:chaide,代碼行數:4,代碼來源:Characteristic.php

示例15: getRefProduct

 public function getRefProduct()
 {
     return $this->hasOne(Product::className(), ['barcode' => 'ref_product_id']);
 }
開發者ID:kaniou,項目名稱:yii2pos,代碼行數:4,代碼來源:Product.php


注:本文中的app\models\Product::className方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。