11 12 13 14 final class UserEntity { public static function build( string $email,... ): self {...} public static function reconstruct( UserEloquent $user ): self {...} } Factoryメソッド
11 12 13 14 final class UserEntity { public function becomesPremium(): self { if ($this->age < 18) {throw …} $this->eloquent->plan = …; return new self($this->eloquent); } } ビジネスロジック