|
- <?php
-
-
-
- namespace domain\Distribution\PointSaleDistribution;
-
- use common\components\ActiveRecordCommon;
- use domain\Distribution\Distribution\Distribution;
- use domain\PointSale\PointSale\PointSale;
-
- class PointSaleDistribution extends ActiveRecordCommon
- {
- var $points_sale_distribution;
-
-
-
- public static function tableName()
- {
- return 'point_sale_distribution';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_distribution', 'id_point_sale'], 'required'],
- [['id_distribution', 'id_point_sale', 'delivery'], 'integer'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id_distribution' => 'Distribution',
- 'id_point_sale' => 'Point de vente',
- 'delivery' => 'Livraison',
- ];
- }
-
-
-
-
- public function getDistribution()
- {
- return $this->hasOne(Distribution::class, ['id' => 'id_distribution']);
- }
-
- public function populateDistribution(Distribution $distribution): void
- {
- $this->populateFieldObject('id_distribution', 'distribution', $distribution);
- }
-
- public function getPointSale()
- {
- return $this->hasOne(PointSale::class, ['id' => 'id_point_sale']);
- }
-
- public function populatePointSale(PointSale $pointSale): void
- {
- $this->populateFieldObject('id_point_sale', 'pointSale', $pointSale);
- }
- }
|