TimestampBehavior::class, ], [ 'class' => PrimaryKeyValueBehavior::class, 'value' => function() { return Uuid::uuid4()->toString(); }, ], ]; } public function getAccount(): AccountQuery { /** @noinspection PhpIncompatibleReturnTypeInspection */ return $this->hasOne(Account::class, ['id' => 'account_id']); } public function isExpired(): bool { return time() > $this->updated_at + self::LIFETIME; } }