ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilConditionFactory Class Reference

Condition factory. More...

+ Collaboration diagram for ilConditionFactory:

Public Member Functions

 __construct (ilConditionObjectAdapterInterface $cond_obj_adapter=null)
 Constructor. More...
 
 repositoryTrigger ($ref_id)
 Repository condition trigger object. More...
 
 set ($conditions)
 Condition set. More...
 
 condition (ilConditionTrigger $trigger, $operator, $value=null)
 Condition. More...
 
 operator ()
 Standard operator factory. More...
 

Protected Attributes

 $cond_obj_adapter
 

Detailed Description

Condition factory.

Author
.de

Definition at line 11 of file class.ilConditionFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilConditionFactory::__construct ( ilConditionObjectAdapterInterface  $cond_obj_adapter = null)

Constructor.

Definition at line 21 of file class.ilConditionFactory.php.

References $cond_obj_adapter.

22  {
23  if (is_null($cond_obj_adapter)) {
24  $this->cond_obj_adapter = new ilConditionObjectAdapter();
25  }
26  }
Wraps ilObject dependencies.

Member Function Documentation

◆ condition()

ilConditionFactory::condition ( ilConditionTrigger  $trigger,
  $operator,
  $value = null 
)

Condition.

Parameters
ilConditionTrigger$trigger
string$operator
string$value
Returns
ilCondition

Definition at line 61 of file class.ilConditionFactory.php.

62  {
63  return new ilCondition($trigger, $operator, $value);
64  }
Condition class.

◆ operator()

ilConditionFactory::operator ( )

Standard operator factory.

Returns
ilConditionOperatorFactory

Definition at line 72 of file class.ilConditionFactory.php.

73  {
74  return new ilConditionOperatorFactory();
75  }
Currently wraps standard operator constants.

◆ repositoryTrigger()

ilConditionFactory::repositoryTrigger (   $ref_id)

Repository condition trigger object.

Parameters
int$a_ref_idref id of trigger object
Returns
ilConditionTrigger

Definition at line 34 of file class.ilConditionFactory.php.

35  {
36  $obj_id = $this->cond_obj_adapter->getObjIdForRefId($ref_id);
37  $obj_type = $this->cond_obj_adapter->getTypeForObjId($obj_id);
38  return new ilConditionTrigger($ref_id, $obj_id, $obj_type);
39  }
Represents a condition trigger object.

◆ set()

ilConditionFactory::set (   $conditions)

Condition set.

Parameters
ilCondition[]$conditions
Returns
ilConditionSet

Definition at line 48 of file class.ilConditionFactory.php.

49  {
50  return new ilConditionSet($conditions);
51  }

Field Documentation

◆ $cond_obj_adapter

ilConditionFactory::$cond_obj_adapter
protected

Definition at line 16 of file class.ilConditionFactory.php.

Referenced by __construct().


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