当前位置: 首页>>代码示例>>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;未经允许,请勿转载。