*/ final class OpenTracking { private ?string $active; public static function create(array $data): self { $active = $data['active'] ?? null; $model = new self(); $model->active = $active ? 'yes' : 'no'; return $model; } private function __construct() { } /** * @return string|null */ public function getActive(): ?string { return $this->active; } /** * @return bool */ public function isActive(): bool { return 'yes' === $this->getActive(); } }