TimestampBehavior::class, 'updatedAtAttribute' => 'last_refreshed_at', ], ]; } public function getAccount(): ActiveQuery { return $this->hasOne(Account::class, ['id' => 'account_id']); } public function generateRefreshToken(): void { $this->refresh_token = Yii::$app->security->generateRandomString(96); } public function setIp($ip): void { $this->last_used_ip = ip2long($ip); } public function getReadableIp(): string { return long2ip($this->last_used_ip); } }