|
- <?php
-
-
-
- namespace domain\PointSale\UserPointSale;
-
- use common\components\ActiveRecordCommon;
- use domain\PointSale\PointSale\PointSale;
- use domain\User\User\User;
-
- class UserPointSale extends ActiveRecordCommon
- {
-
-
- public static function tableName()
- {
- return 'user_point_sale';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_point_sale', 'id_user'], 'required'],
- [['id_point_sale', 'id_user'], 'integer'],
- [['comment'], 'string'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id_point_sale' => 'Point de vente',
- 'id_user' => 'Utilisateur',
- 'comment' => 'Commentaire'
- ];
- }
-
- 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);
- }
-
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'id_user']);
- }
-
- public function populateUser(User $user): void
- {
- $this->populateFieldObject('id_user', 'user', $user);
- }
- }
|