/** * @return \yii\db\ActiveQuery */ public function getShop() { return $this->hasOne(Shop::className(), ['id' => 'shop_id']); }
/** * @return \yii\db\ActiveQuery */ public function getShop() { return $this->hasOne(\common\models\Shop::className(), ['id' => 'shop_id']); }
/** * @return \yii\db\ActiveQuery */ public function getShops() { return $this->hasMany(Shop::className(), ['category_id' => 'id']); }
public function rules() { return ArrayHelper::merge(parent::rules(), [[['shop_id', 'date'], 'required'], [['shop_id', 'is_live'], 'integer'], [['notes'], 'string'], [['image'], 'safe'], [['shop_id'], 'exist', 'skipOnError' => true, 'targetClass' => Shop::className(), 'targetAttribute' => ['shop_id' => 'id']], [['date'], 'date', 'format' => 'php:Y-m-d']]); }