Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool_usertours\target Class Reference

Target class. More...

Static Public Member Functions

static get_classname ($type)
 Return the name of the class for this target type.
 
static get_target_constant ($type)
 Return the constant used to describe this target.
 
static get_target_constant_for_class ($classname)
 Return the constant used to describe this class.
 
static get_target_instance (step $step)
 Return the instance of the class for this target.
 
static get_target_type (step $step)
 Return the instance of the class for this target.
 
static get_target_types ()
 Return the complete lits of target types.
 

Public Attributes

TARGET_BLOCK const TARGET_BLOCK = 1
 The target is a block.
 
TARGET_SELECTOR const TARGET_SELECTOR = 0
 The target is a CSS selector.
 
TARGET_UNATTACHED const TARGET_UNATTACHED = 2
 The target is unattached to any specific node.
 

Static Protected Attributes

static array $mapping
 $mapping The list of target type to target name.
 

Detailed Description

Target class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_classname()

static tool_usertours\target::get_classname ( $type)
static

Return the name of the class for this target type.

Parameters
int$typeThe type of target.
Return values
stringThe class name.

◆ get_target_constant()

static tool_usertours\target::get_target_constant ( $type)
static

Return the constant used to describe this target.

Parameters
string$typeThe type of the target.
Return values
intThe constant for this target.

◆ get_target_constant_for_class()

static tool_usertours\target::get_target_constant_for_class ( $classname)
static

Return the constant used to describe this class.

Parameters
string$classnameThe fully-qualified class name of the target
Return values
intThe constant for this target.

◆ get_target_instance()

static tool_usertours\target::get_target_instance ( step $step)
static

Return the instance of the class for this target.

Parameters
step$stepThe step.
Return values
targetThe target instance.

◆ get_target_type()

static tool_usertours\target::get_target_type ( step $step)
static

Return the instance of the class for this target.

Parameters
step$stepThe step.
Return values
targetThe target instance.

◆ get_target_types()

static tool_usertours\target::get_target_types ( )
static

Return the complete lits of target types.

Return values
array

Member Data Documentation

◆ $mapping

array tool_usertours\target::$mapping
staticprotected
Initial value:
= [
self::TARGET_BLOCK => 'block',
self::TARGET_SELECTOR => 'selector',
self::TARGET_UNATTACHED => 'unattached',
]

$mapping The list of target type to target name.


The documentation for this class was generated from the following file: