Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 346 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Conditional:: (19 methods):
  __construct()
  getConditionType()
  setConditionType()
  getOperatorType()
  setOperatorType()
  getText()
  setText()
  getStopIfTrue()
  setStopIfTrue()
  getConditions()
  setConditions()
  addCondition()
  getStyle()
  setStyle()
  getDataBar()
  setDataBar()
  getHashCode()
  __clone()
  isValidConditionType()


Class: Conditional  - X-Ref

__construct()   X-Ref
Create a new Conditional.


getConditionType()   X-Ref
Get Condition type.

return: string

setConditionType($type)   X-Ref
Set Condition type.

param: string $type Condition type, see self::CONDITION_*
return: $this

getOperatorType()   X-Ref
Get Operator type.

return: string

setOperatorType($type)   X-Ref
Set Operator type.

param: string $type Conditional operator type, see self::OPERATOR_*
return: $this

getText()   X-Ref
Get text.

return: string

setText($text)   X-Ref
Set text.

param: string $text
return: $this

getStopIfTrue()   X-Ref
Get StopIfTrue.

return: bool

setStopIfTrue($stopIfTrue)   X-Ref
Set StopIfTrue.

param: bool $stopIfTrue
return: $this

getConditions()   X-Ref
Get Conditions.

return: (bool|float|int|string)[]

setConditions($conditions)   X-Ref
Set Conditions.

param: bool|float|int|string|(bool|float|int|string)[] $conditions Condition
return: $this

addCondition($condition)   X-Ref
Add Condition.

param: bool|float|int|string $condition Condition
return: $this

getStyle()   X-Ref
Get Style.

return: Style

setStyle(Style $style)   X-Ref
Set Style.

return: $this

getDataBar()   X-Ref
get DataBar.

return: null|ConditionalDataBar

setDataBar(ConditionalDataBar $dataBar)   X-Ref
set DataBar.

return: $this

getHashCode()   X-Ref
Get hash code.

return: string Hash code

__clone()   X-Ref
Implement PHP __clone to create a deep clone, not just a shallow copy.


isValidConditionType(string $type)   X-Ref
Verify if param is valid condition type.