= 1 && $roleNumber <= 3) { return new OrganizationRole( id: $id, organizationId: $organizationId, friendlyName: "Role " . $roleNumber . " of org " . $organizationId, membersGroup: $id ); } } throw new OrganizationRoleNotFound("demo", $id); } /** * @return OrganizationRole[] */ public function getRolesOfOrganization(int $organizationId): array { if(in_array($organizationId, self::DEMO_ORGANIZATIONS)) { $result = []; for($i = 1; $i <= 3; $i++) { $result[] = new OrganizationRole( id: $organizationId . "_" . $i, organizationId: $organizationId, friendlyName: "Role " . $i . " of org " . $organizationId, membersGroup: $organizationId . "_" . $i ); } return $result; } else { return []; } } }