本文整理汇总了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]);
}
}
示例2: getProducts0
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts0()
{
return $this->hasMany(Product::className(), ['updated_by' => 'updated_by']);
}
示例3: getProducts
public function getProducts()
{
return $this->hasMany(Product::className(), ['id_history' => 'id']);
}
示例4: getProduct
/**
* @return \yii\db\ActiveQuery
*/
public function getProduct()
{
return $this->hasOne(Product::className(), ['id' => 'product_id']);
}
示例5: getProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['section_id' => 'id_section']);
}
示例6: getProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['id' => 'productId'])->viaTable('product_has_loyalty', ['loyaltyId' => 'id']);
}
示例7: getItem
/**
* @return \yii\db\ActiveQuery
*/
public function getItem()
{
return $this->hasOne(Product::className(), ['item_id' => 'item_id']);
}
示例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']);
}
示例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);
}
示例10: getProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['subcategory_id' => 'id'])->where('status="ACTIVE" AND auction="NO"');
}
示例11: getProducts
/**
* @return ProductQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['SupplierID' => 'SupplierID'])->inverseOf('supplier');
}
示例12: getProducts
public function getProducts()
{
return $this->hasMany(Product::className(), ['goods_id' => 'goods_id'])->asArray();
}
示例13: getProduct
/**
* @return ProductQuery
*/
public function getProduct()
{
return $this->hasOne(Product::className(), ['ProductID' => 'ProductID'])->inverseOf('orderDetails');
}
示例14: getProducts
public function getProducts()
{
return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('product_characteristic', ['characteristic_id' => 'id']);
}
示例15: getRefProduct
public function getRefProduct()
{
return $this->hasOne(Product::className(), ['barcode' => 'ref_product_id']);
}