Menu

## SiteHelper
in package

SiteHelper.php : 48

Class SiteHelper

Central helper class providing cached lookup data and reusable business logic across the application.

Responsibilities include:

- Academic year resolution
- Location data (Country, State, City)
- Teacher & student related utilities
- Static dropdown lists
- Cached master data access

All methods are static and cache-aware.

### Table of Contents

#### Methods

getAcademicYear() : AcademicYear|null
  Get the current academic year for a school.
getAcademicYearStatusList() : array<string|int, mixed>
  Get the list of academic year statuses.
getAdditionalCertificates() : Collection
  Get the list of additional certificates.
getAdmin() : User|null
  Get the administrator user for a given school.
getBloodGroups() : array<string|int, mixed>
  Get the list of blood groups.
getCasteList() : array<string|int, mixed>
  Get the list of caste categories.
getCities() : Collection
  Get the list of cities grouped by state.
getClasCooridnators() : Builder
  Get class coordinators for a school.
getClassStudentCount() : int
  Get the total number of active students in a class.
getClassStudents() : Collection
  Get the list of students for a specific class.
getCountries() : Collection
  Get the list of active countries.
getFeedbackCategoryList() : array<string|int, mixed>
  Get the list of feedback categories.
getHODList() : Collection
  Get the list of Heads of Department (HOD) for a school.
getMaritalList() : array<string|int, mixed>
  Get the list of marital statuses.
getNonScholasticList() : Collection
  Get the non-scholastic grading list for a school.
getNonTeachingDesignations() : array<string|int, mixed>
  Get the list of non-teaching staff designations.
getPendingLeaveCount() : int
  Get the count of pending leave applications under a teacher.
getPGList() : Collection
  Get the list of postgraduate (PG) qualifications.
getPrincipalList() : Collection
  Get the list of principals and vice principals for a school.
getQualifications() : Collection
  Get the list of qualifications.
getScholasticList() : Collection
  Get the scholastic grading list for a school.
getStandardLinkList() : Collection|null
  Get the list of standard links for a school.
getStandardList() : Collection|null
  Get the list of standards for a school.
getStandardSubjectList() : Collection}
  Get standard and subject list assigned to a teacher.
getStates() : Collection
  Get the list of states grouped by country.
getTaskAssigneeList() : array<string|int, mixed>
  Get the list of task assignee types.
getTaskReminderList() : array<string|int, mixed>
  Get the list of task reminder options.
getTeachers() : Collection
  Get the list of teachers for a school and academic year.
getTeachingDesignations() : array<string|int, mixed>
  Get the list of teaching staff designations.
getTeachingStaffList() : Collection
  Get the list of active teaching staff for a school.
getTransportList() : array<string|int, mixed>
  Get the list of transport modes.
getUGList() : Collection
  Get the list of undergraduate (UG) qualifications.

### Methods

#### getAcademicYear()

SiteHelper.php : 57

Get the current academic year for a school.

`public static getAcademicYear(int|string $school_id) : AcademicYear|null`

##### Parameters

$school_id : int|string

##### Return values

AcademicYear|null

#### getAcademicYearStatusList()

SiteHelper.php : 757

Get the list of academic year statuses.

`public static getAcademicYearStatusList() : array<string|int, mixed>`

Returns a cached list of academic year states used across academic year management.

##### Return values

array<string|int, mixed>

#### getAdditionalCertificates()

SiteHelper.php : 164

Get the list of additional certificates.

`public static getAdditionalCertificates() : Collection`

Returns active qualifications of types:

- teacher
- others

Results are cached for performance.

##### Return values

Collection

#### getAdmin()

SiteHelper.php : 81

Get the administrator user for a given school.

`public static getAdmin(int|string $school_id) : User|null`

The result is cached to improve performance. The administrator is resolved based on the school ID and user role.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

User|null

#### getBloodGroups()

SiteHelper.php : 296

Get the list of blood groups.

`public static getBloodGroups() : array<string|int, mixed>`

Returns a cached list of blood groups with identifier and display name.

##### Return values

array<string|int, mixed>

#### getCasteList()

SiteHelper.php : 343

Get the list of caste categories.

`public static getCasteList() : array<string|int, mixed>`

Returns a cached list of caste options with identifier and display name.

##### Return values

array<string|int, mixed>

#### getCities()

SiteHelper.php : 128

Get the list of cities grouped by state.

`public static getCities() : Collection`

The cities are cached and returned as a resource collection grouped by `state_id`.

##### Return values

Collection

#### getClasCooridnators()

SiteHelper.php : 782

Get class coordinators for a school.

`public static getClasCooridnators(int|string $school_id, int|string $auth_id) : Builder`

Returns active users (excluding the authenticated user) who are assigned the `class_coordinator` role.

##### Parameters

$school_id : int|string

  School identifier

$auth_id : int|string

  Authenticated user identifier

##### Return values

Builder

#### getClassStudentCount()

SiteHelper.php : 400

Get the total number of active students in a class.

`public static getClassStudentCount(int|string $school_id, int|string $academic_year_id, int|string $standardLink_id) : int`

Counts students based on:

- School
- Academic year
- Standard & section (standardLink)

Result is cached per class for performance.

##### Parameters

$school_id : int|string

  School identifier

$academic_year_id : int|string

  Academic year identifier

$standardLink_id : int|string

  Standard-link identifier

##### Return values

int

#### getClassStudents()

SiteHelper.php : 593

Get the list of students for a specific class.

`public static getClassStudents(int|string $school_id, int|string $academic_year_id, int|string $standardLink_id) : Collection`

Fetches active students based on:

- School
- Academic year
- Standard & section (standardLink)

Results are cached per class and sorted by student's first name.

##### Parameters

$school_id : int|string

  School identifier

$academic_year_id : int|string

  Academic year identifier

$standardLink_id : int|string

  Standard-link identifier

##### Return values

Collection

#### getCountries()

SiteHelper.php : 98

Get the list of active countries.

`public static getCountries() : Collection`

The countries are cached to improve performance and returned as a resource collection keyed by ID.

##### Return values

Collection

#### getFeedbackCategoryList()

SiteHelper.php : 561

Get the list of feedback categories.

`public static getFeedbackCategoryList() : array<string|int, mixed>`

Returns a cached list of predefined feedback categories used for feedback and support modules.

##### Return values

array<string|int, mixed>

#### getHODList()

SiteHelper.php : 426

Get the list of Heads of Department (HOD) for a school.

`public static getHODList(int|string $school_id) : Collection`

Filters teachers by:

- Active status
- Head of the Department designation
- Current academic year

Results are cached per school and academic year.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection

#### getMaritalList()

SiteHelper.php : 319

Get the list of marital statuses.

`public static getMaritalList() : array<string|int, mixed>`

Returns a cached list of marital status options with identifier and display name.

##### Return values

array<string|int, mixed>

#### getNonScholasticList()

SiteHelper.php : 695

Get the non-scholastic grading list for a school.

`public static getNonScholasticList(int|string $school_id) : Collection`

Returns non-scholastic grade definitions configured for the given school as a resource collection.

Results are cached per school.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection

#### getNonTeachingDesignations()

SiteHelper.php : 273

Get the list of non-teaching staff designations.

`public static getNonTeachingDesignations() : array<string|int, mixed>`

Returns a cached list of predefined non-teaching designations with identifier and display name.

##### Return values

array<string|int, mixed>

#### getPendingLeaveCount()

SiteHelper.php : 646

Get the count of pending leave applications under a teacher.

`public static getPendingLeaveCount(int|string $school_id, int|string $academic_year_id, int|string $teacher_id) : int`

Calculates pending leave requests submitted by teachers who report to the given teacher for a specific school and academic year.

Result is cached per school, academic year, and teacher.

##### Parameters

$school_id : int|string

  School identifier

$academic_year_id : int|string

  Academic year identifier

$teacher_id : int|string

  Reporting teacher identifier

##### Return values

int

#### getPGList()

SiteHelper.php : 192

Get the list of postgraduate (PG) qualifications.

`public static getPGList() : Collection`

Returns active qualifications of type `pg`. Results are cached for better performance.

##### Return values

Collection

#### getPrincipalList()

SiteHelper.php : 454

Get the list of principals and vice principals for a school.

`public static getPrincipalList(int|string $school_id) : Collection`

Filters active teaching staff with designation:

- principal
- vice_principal

Results are cached per school and academic year.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection

#### getQualifications()

SiteHelper.php : 147

Get the list of qualifications.

`public static getQualifications() : Collection`

Returns active qualifications of types:

- others
- pg
- ug

Results are cached for performance.

##### Return values

Collection

#### getScholasticList()

SiteHelper.php : 676

Get the scholastic grading list for a school.

`public static getScholasticList(int|string $school_id) : Collection`

Returns scholastic grade definitions configured for the given school as a resource collection.

Results are cached per school.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection

#### getStandardLinkList()

SiteHelper.php : 210

Get the list of standard links for a school.

`public static getStandardLinkList(int|string $school_id) : Collection|null`

Fetches standards and sections mapped for the current academic year and returns them as a resource collection ordered by standard and section.

Results are cached per school.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection|null

#### getStandardList()

SiteHelper.php : 234

Get the list of standards for a school.

`public static getStandardList(int|string $school_id) : Collection|null`

Returns standards ordered by display order and wrapped in a resource collection.

Results are cached per school.

##### Parameters

$school_id : int|string

  School identifier

##### Return values

Collection|null

#### getStandardSubjectList()

SiteHelper.php : 514

Get standard and subject list assigned to a teacher.

`public static getStandardSubjectList(int|string $school_id, int|string $teacher_id) : Collection}`

This method returns:

- Standards where the teacher is a class teacher
- Standards where the teacher is assigned as a subject teacher
- Subjects grouped by standard link

Data is resolved for the current academic year.

##### Parameters

$school_id : int|string

  School identifier

$teacher_id : int|string

  Teacher identifier

##### Return values

Collection}

#### getStates()

SiteHelper.php : 113

Get the list of states grouped by country.

`public static getStates() : Collection`

The states are cached and returned as a resource collection grouped by `country_id`.

##### Return values

Collection

#### getTaskAssigneeList()

SiteHelper.php : 711

Get the list of task assignee types.

`public static getTaskAssigneeList() : array<string|int, mixed>`

Returns a cached list of predefined task assignees used in task or reminder modules.

##### Return values

array<string|int, mixed>

#### getTaskReminderList()

SiteHelper.php : 734

Get the list of task reminder options.

`public static getTaskReminderList() : array<string|int, mixed>`

Returns a cached list of predefined reminder timings used for task notifications.

##### Return values

array<string|int, mixed>

#### getTeachers()

SiteHelper.php : 620

Get the list of teachers for a school and academic year.

`public static getTeachers(int|string $school_id, int|string $academic_year_id) : Collection`

Fetches active teaching staff across multiple user groups and sorts them by first name.

Results are cached per school and academic year.

##### Parameters

$school_id : int|string

  School identifier

$academic_year_id : int|string

  Academic year identifier

##### Return values

Collection

#### getTeachingDesignations()

SiteHelper.php : 252

Get the list of teaching staff designations.

`public static getTeachingDesignations() : array<string|int, mixed>`

Returns a cached list of predefined teaching designations with identifier and display name.

##### Return values

array<string|int, mixed>

#### getTeachingStaffList()

SiteHelper.php : 484

Get the list of active teaching staff for a school.

`public static getTeachingStaffList(int|string $school_id, int|string $academic_year_id) : Collection`

Filters users by:

- Teaching user group
- Active status
- Academic year

Results are cached per school and academic year.

##### Parameters

$school_id : int|string

  School identifier

$academic_year_id : int|string

  Academic year identifier

##### Return values

Collection

#### getTransportList()

SiteHelper.php : 368

Get the list of transport modes.

`public static getTransportList() : array<string|int, mixed>`

Returns a cached list of transport options with identifier and display name.

##### Return values

array<string|int, mixed>

#### getUGList()

SiteHelper.php : 178

Get the list of undergraduate (UG) qualifications.

`public static getUGList() : Collection`

Returns active qualifications of type `ug`. Results are cached for performance.

##### Return values

Collection

## Search results