|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
-
-
-
- namespace domain\User\UserUserGroup;
-
- use common\components\ActiveRecordCommon;
- use domain\PointSale\PointSale\PointSale;
- use domain\User\User\User;
- use domain\User\UserGroup\UserGroup;
-
-
- class UserUserGroup extends ActiveRecordCommon
- {
-
-
- public static function tableName()
- {
- return 'user_user_group';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_user', 'id_user_group'], 'required'],
- [['id_user', 'id_user_group'], 'integer'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id_user' => 'Utilisateur',
- 'id_user_group' => 'Groupe'
- ];
- }
-
- 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 getUserGroup()
- {
- return $this->hasOne(UserGroup::class, ['id' => 'id_user_group']);
- }
-
- public function populateUserGroup(UserGroup $userGroup): void
- {
- $this->populateFieldObject('id_user_group', 'userGroup', $userGroup);
- }
-
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'id_user']);
- }
-
- public function populateUser(User $user): void
- {
- $this->populateFieldObject('id_user', 'user', $user);
- }
- }
|