$row */ public static function fromRow(array $row): ?self { $goal = Goal::tryFrom((string) ($row['goal'] ?? '')); if ($goal === null) { return null; } return new self( (string) ($row['id'] ?? ''), (string) ($row['name'] ?? ''), $goal, ($row['deleted_at'] ?? null) !== null, (bool) ($row['was_published'] ?? false), ($row['published_at'] ?? null) !== null, isset($row['parent_id']) ? (string) $row['parent_id'] : null, isset($row['published_at']) ? (string) $row['published_at'] : null, ); } }