Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 153 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 cohort/lib.php

Defines 1 class

factor:: (7 methods):
  get_all_user_factors()
  has_input()
  get_state()
  set_state()
  possible_states()
  get_summary_condition()
  get_cohorts()


Class: factor  - X-Ref

cohort factor class.

get_all_user_factors(stdClass $user)   X-Ref
cohort implementation.
This factor is a singleton, return single instance.

param: stdClass $user the user to check against.
return: array

has_input()   X-Ref
cohort implementation.
Factor has no input

{@inheritDoc}

get_state()   X-Ref
cohort implementation.
Checks whether the user has selected cohorts in any context.

{@inheritDoc}

set_state(string $state)   X-Ref
cohort implementation.
Cannot set state, return true.

param: string $state the state constant to set
return: bool

possible_states(stdClass $user)   X-Ref
cohort implementation.
User can not influence. Result is whatever current state is.

param: stdClass $user

get_summary_condition()   X-Ref
cohort implementation
Formats the cohort list nicely.

{@inheritDoc}

get_cohorts(array $selectedcohorts)   X-Ref
Get cohorts information by given ids.

param: array $selectedcohorts List of cohort ids.
return: array