本文整理汇总了PHP中common\models\Product::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Product::className方法的具体用法?PHP Product::className怎么用?PHP Product::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Product
的用法示例。
在下文中一共展示了Product::className方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProduct
public function getProduct()
{
/**
* 第一个参数为要关联的字表模型类名称,
* 第二个参数指定 通过子表的 customer_id 去关联主表的 id 字段
*/
return $this->hasOne(Product::className(), ['product_id' => 'product_id']);
}
示例2: getObject0
/**
* @return \yii\db\ActiveQuery
*/
public function getObject0()
{
return $this->hasOne(Product::className(), ['id' => 'object_id']);
}
示例3: getProduct
/**
* @return \yii\db\ActiveQuery
*/
public function getProduct()
{
return $this->hasOne(Product::className(), ['product_id' => 'product_id']);
}
示例4: getProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['category_id' => 'id']);
}
示例5: getProduct
public function getProduct()
{
if (!isset($this->_product)) {
$this->_product = Yii::createObject(Product::className());
}
return $this->_product;
}
示例6: getProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getProducts()
{
return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('{{%entp_product}}', ['entrepreneur_user_id' => 'user_id']);
}
示例7: getWishProducts
/**
* @return \yii\db\ActiveQuery
*/
public function getWishProducts()
{
return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('wishlist', ['user_id' => 'id']);
}
示例8: actions
/**
* @return array
*/
public function actions()
{
return ['update-cat' => ['class' => crudActionUpdate::className(), 'modelClass' => Category::className(), 'view' => 'update-cat', 'onAfterAction' => [$this, 'afterSaveCategory']], 'delete-cat' => ['class' => crudActionDelete::className(), 'modelClass' => Category::className(), 'onAfterAction' => [$this, 'afterDeleteCategory']], 'insert-product' => ['class' => crudActionCreate::className(), 'modelClass' => Product::className(), 'attributes' => ['parents' => (array) Yii::$app->getRequest()->get('cat_id')], 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'update-product' => ['class' => crudActionUpdate::className(), 'modelClass' => Product::className(), 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'delete-product' => ['class' => crudActionDelete::className(), 'modelClass' => Product::className(), 'onAfterAction' => [$this, 'afterDeleteProduct']]];
}
示例9: getProduct
/**
* @return \yii\db\ActiveQuery
*/
public function getProduct()
{
return $this->hasOne(\common\models\Product::className(), ['id' => 'product_id']);
}
示例10: actions
public function actions()
{
return ['toggle' => ['class' => ToggleAction::className(), 'modelClass' => Product::className()]];
}
示例11: getProducts
public function getProducts()
{
return $this->hasMany(Product::className(), ['organization_id' => 'id']);
}