diff --git a/Makefile b/Makefile index 787515a1..fbf4ef6e 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ composershow: composerupdate: docker compose run --rm cli composer update make composershow + make basemodels db: docker compose up -d db diff --git a/application/common/models/EmailLogBase.php b/application/common/models/EmailLogBase.php index fcbc7ef8..c7a8ede9 100644 --- a/application/common/models/EmailLogBase.php +++ b/application/common/models/EmailLogBase.php @@ -34,7 +34,7 @@ public function rules() [['user_id'], 'integer'], [['message_type'], 'string'], [['sent_utc'], 'safe'], - [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], + [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } @@ -58,6 +58,6 @@ public function attributeLabels() */ public function getUser() { - return $this->hasOne(User::className(), ['id' => 'user_id']); + return $this->hasOne(User::class, ['id' => 'user_id']); } } diff --git a/application/common/models/InviteBase.php b/application/common/models/InviteBase.php index c7e41429..78e526ca 100644 --- a/application/common/models/InviteBase.php +++ b/application/common/models/InviteBase.php @@ -35,7 +35,7 @@ public function rules() [['user_id'], 'integer'], [['created_utc', 'expires_on'], 'safe'], [['uuid'], 'string', 'max' => 36], - [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], + [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } @@ -60,6 +60,6 @@ public function attributeLabels() */ public function getUser() { - return $this->hasOne(User::className(), ['id' => 'user_id']); + return $this->hasOne(User::class, ['id' => 'user_id']); } } diff --git a/application/common/models/MethodBase.php b/application/common/models/MethodBase.php index 4dc6ab73..899dbf87 100644 --- a/application/common/models/MethodBase.php +++ b/application/common/models/MethodBase.php @@ -44,7 +44,7 @@ public function rules() [['uid'], 'unique'], [['user_id', 'value'], 'unique', 'targetAttribute' => ['user_id', 'value']], [['verification_code'], 'unique'], - [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], + [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } @@ -73,6 +73,6 @@ public function attributeLabels() */ public function getUser() { - return $this->hasOne(User::className(), ['id' => 'user_id']); + return $this->hasOne(User::class, ['id' => 'user_id']); } } diff --git a/application/common/models/MfaBackupcodeBase.php b/application/common/models/MfaBackupcodeBase.php index 663899aa..0e5cd909 100644 --- a/application/common/models/MfaBackupcodeBase.php +++ b/application/common/models/MfaBackupcodeBase.php @@ -35,7 +35,7 @@ public function rules() [['mfa_id'], 'integer'], [['created_utc', 'expires_utc'], 'safe'], [['value'], 'string', 'max' => 255], - [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::className(), 'targetAttribute' => ['mfa_id' => 'id']], + [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::class, 'targetAttribute' => ['mfa_id' => 'id']], ]; } @@ -60,6 +60,6 @@ public function attributeLabels() */ public function getMfa() { - return $this->hasOne(Mfa::className(), ['id' => 'mfa_id']); + return $this->hasOne(Mfa::class, ['id' => 'mfa_id']); } } diff --git a/application/common/models/MfaBase.php b/application/common/models/MfaBase.php index 46a1f351..fe9b8004 100644 --- a/application/common/models/MfaBase.php +++ b/application/common/models/MfaBase.php @@ -44,7 +44,7 @@ public function rules() [['created_utc', 'last_used_utc'], 'safe'], [['external_uuid', 'label'], 'string', 'max' => 64], [['key_handle_hash'], 'string', 'max' => 255], - [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], + [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } @@ -73,7 +73,7 @@ public function attributeLabels() */ public function getMfaBackupcodes() { - return $this->hasMany(MfaBackupcode::className(), ['mfa_id' => 'id']); + return $this->hasMany(MfaBackupcode::class, ['mfa_id' => 'id']); } /** @@ -83,7 +83,7 @@ public function getMfaBackupcodes() */ public function getMfaFailedAttempts() { - return $this->hasMany(MfaFailedAttempt::className(), ['mfa_id' => 'id']); + return $this->hasMany(MfaFailedAttempt::class, ['mfa_id' => 'id']); } /** @@ -93,7 +93,7 @@ public function getMfaFailedAttempts() */ public function getMfaWebauthns() { - return $this->hasMany(MfaWebauthn::className(), ['mfa_id' => 'id']); + return $this->hasMany(MfaWebauthn::class, ['mfa_id' => 'id']); } /** @@ -103,6 +103,6 @@ public function getMfaWebauthns() */ public function getUser() { - return $this->hasOne(User::className(), ['id' => 'user_id']); + return $this->hasOne(User::class, ['id' => 'user_id']); } } diff --git a/application/common/models/MfaFailedAttemptBase.php b/application/common/models/MfaFailedAttemptBase.php index ce212aaf..12155d53 100644 --- a/application/common/models/MfaFailedAttemptBase.php +++ b/application/common/models/MfaFailedAttemptBase.php @@ -32,7 +32,7 @@ public function rules() [['mfa_id', 'at_utc'], 'required'], [['mfa_id'], 'integer'], [['at_utc'], 'safe'], - [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::className(), 'targetAttribute' => ['mfa_id' => 'id']], + [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::class, 'targetAttribute' => ['mfa_id' => 'id']], ]; } @@ -55,6 +55,6 @@ public function attributeLabels() */ public function getMfa() { - return $this->hasOne(Mfa::className(), ['id' => 'mfa_id']); + return $this->hasOne(Mfa::class, ['id' => 'mfa_id']); } } diff --git a/application/common/models/MfaWebauthnBase.php b/application/common/models/MfaWebauthnBase.php index 1f1c14fa..afd78408 100644 --- a/application/common/models/MfaWebauthnBase.php +++ b/application/common/models/MfaWebauthnBase.php @@ -37,7 +37,7 @@ public function rules() [['created_utc', 'last_used_utc'], 'safe'], [['key_handle_hash'], 'string', 'max' => 255], [['label'], 'string', 'max' => 64], - [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::className(), 'targetAttribute' => ['mfa_id' => 'id']], + [['mfa_id'], 'exist', 'skipOnError' => true, 'targetClass' => Mfa::class, 'targetAttribute' => ['mfa_id' => 'id']], ]; } @@ -63,6 +63,6 @@ public function attributeLabels() */ public function getMfa() { - return $this->hasOne(Mfa::className(), ['id' => 'mfa_id']); + return $this->hasOne(Mfa::class, ['id' => 'mfa_id']); } } diff --git a/application/common/models/PasswordBase.php b/application/common/models/PasswordBase.php index a93c36dc..a63f359a 100644 --- a/application/common/models/PasswordBase.php +++ b/application/common/models/PasswordBase.php @@ -66,6 +66,6 @@ public function attributeLabels() */ public function getUsers() { - return $this->hasMany(User::className(), ['current_password_id' => 'id']); + return $this->hasMany(User::class, ['current_password_id' => 'id']); } } diff --git a/application/common/models/UserBase.php b/application/common/models/UserBase.php index 245d396c..217dd5e0 100644 --- a/application/common/models/UserBase.php +++ b/application/common/models/UserBase.php @@ -64,7 +64,7 @@ public function rules() [['employee_id'], 'unique'], [['username'], 'unique'], [['email'], 'unique'], - [['current_password_id'], 'exist', 'skipOnError' => true, 'targetClass' => Password::className(), 'targetAttribute' => ['current_password_id' => 'id']], + [['current_password_id'], 'exist', 'skipOnError' => true, 'targetClass' => Password::class, 'targetAttribute' => ['current_password_id' => 'id']], ]; } @@ -109,7 +109,7 @@ public function attributeLabels() */ public function getCurrentPassword() { - return $this->hasOne(Password::className(), ['id' => 'current_password_id']); + return $this->hasOne(Password::class, ['id' => 'current_password_id']); } /** @@ -119,7 +119,7 @@ public function getCurrentPassword() */ public function getEmailLogs() { - return $this->hasMany(EmailLog::className(), ['user_id' => 'id']); + return $this->hasMany(EmailLog::class, ['user_id' => 'id']); } /** @@ -129,7 +129,7 @@ public function getEmailLogs() */ public function getInvites() { - return $this->hasMany(Invite::className(), ['user_id' => 'id']); + return $this->hasMany(Invite::class, ['user_id' => 'id']); } /** @@ -139,7 +139,7 @@ public function getInvites() */ public function getMethods() { - return $this->hasMany(Method::className(), ['user_id' => 'id']); + return $this->hasMany(Method::class, ['user_id' => 'id']); } /** @@ -149,6 +149,6 @@ public function getMethods() */ public function getMfas() { - return $this->hasMany(Mfa::className(), ['user_id' => 'id']); + return $this->hasMany(Mfa::class, ['user_id' => 'id']); } }