ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Conditions\Configuration\ConditionTriggerProvider Class Reference
+ Collaboration diagram for ILIAS\Conditions\Configuration\ConditionTriggerProvider:

Public Member Functions

 __construct (int $target_ref_id, int $target_obj_id, string $target_type)
 
 getData ()
 
 sortData (Order $order)
 
 limitData (Range $range, Order $order)
 

Protected Member Functions

 read ()
 

Private Attributes

int $target_ref_id
 
int $target_obj_id
 
string $target_type
 
array $data = []
 
StaticURL Services $static_url_service
 
UIFactory $ui_factory
 
ilLanguage $lng
 

Detailed Description

Definition at line 31 of file ConditionTriggerProvider.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Conditions\Configuration\ConditionTriggerProvider::__construct ( int  $target_ref_id,
int  $target_obj_id,
string  $target_type 
)

Definition at line 45 of file ConditionTriggerProvider.php.

References $DIC, ILIAS\Conditions\Configuration\ConditionTriggerProvider\$target_obj_id, ILIAS\Conditions\Configuration\ConditionTriggerProvider\$target_ref_id, ILIAS\Conditions\Configuration\ConditionTriggerProvider\$target_type, ILIAS\Repository\lng(), and ILIAS\Conditions\Configuration\ConditionTriggerProvider\read().

46  {
47  global $DIC;
48 
49  $this->static_url_service = $DIC['static_url'];
50  $this->ui_factory = $DIC->ui()->factory();
51  $this->lng = $DIC->language();
52  $this->lng->loadLanguageModule('rbac');
53 
54  $this->target_ref_id = $target_ref_id;
55  $this->target_obj_id = $target_obj_id;
56  $this->target_type = $target_type;
57  $this->read();
58  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getData()

ILIAS\Conditions\Configuration\ConditionTriggerProvider::getData ( )

◆ limitData()

ILIAS\Conditions\Configuration\ConditionTriggerProvider::limitData ( Range  $range,
Order  $order 
)

◆ read()

ILIAS\Conditions\Configuration\ConditionTriggerProvider::read ( )
protected

Definition at line 60 of file ConditionTriggerProvider.php.

References ilConditionHandler\_getPersistedConditionsOfTarget(), ilObject\_lookupTitle(), ilObject\_lookupType(), and ilConditionHandlerGUI\translateOperator().

Referenced by ILIAS\Conditions\Configuration\ConditionTriggerProvider\__construct().

60  : void
61  {
63  $this->target_ref_id,
64  $this->target_obj_id,
65  $this->target_type
66  );
67 
68  foreach ($conditions as $condition) {
69  $row = [];
70  $row['id'] = $condition['id'];
71 
72  $link = $this->static_url_service->builder()->build(
73  ilObject::_lookupType($condition['trigger_ref_id'], true),
74  new ReferenceId($condition['trigger_ref_id'])
75  );
76  $row['trigger'] = $this->ui_factory->link()->standard(
77  ilObject::_lookupTitle($condition['trigger_obj_id']),
78  $link
79  );
80  $row['condition'] = ilConditionHandlerGUI::translateOperator(
81  $condition['trigger_obj_id'],
82  $condition['operator'],
83  $condition['value']
84  );
85 
86  if ($condition['obligatory']) {
87  $row['obligatory'] = $this->ui_factory->symbol()->icon()->custom(
88  'assets/images/standard/icon_checked.svg',
89  '',
90  'small'
91  );
92  }
93  $this->data[] = $row;
94  }
95  }
static translateOperator(int $a_obj_id, string $a_operator, string $value='')
static _lookupTitle(int $obj_id)
static _lookupType(int $id, bool $reference=false)
static _getPersistedConditionsOfTarget(int $a_target_ref_id, int $a_target_obj_id, string $a_target_type="")
get all persisted conditions of target object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sortData()

ILIAS\Conditions\Configuration\ConditionTriggerProvider::sortData ( Order  $order)

Definition at line 102 of file ConditionTriggerProvider.php.

References Vendor\Package\$a, Vendor\Package\$b, ILIAS\Conditions\Configuration\ConditionTriggerProvider\$data, ILIAS\Conditions\Configuration\ConditionTriggerProvider\getData(), and ILIAS\Data\Order\join().

Referenced by ILIAS\Conditions\Configuration\ConditionTriggerProvider\limitData().

102  : array
103  {
104  $data = $this->getData();
105  [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value) => [$key, $value]);
106  usort($data, fn($a, $b) => $a[$order_field] <=> $b[$order_field]);
107  if ($order_direction === 'DESC') {
108  $data = array_reverse($data);
109  }
110  return $data;
111  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data

array ILIAS\Conditions\Configuration\ConditionTriggerProvider::$data = []
private

◆ $lng

ilLanguage ILIAS\Conditions\Configuration\ConditionTriggerProvider::$lng
private

Definition at line 42 of file ConditionTriggerProvider.php.

◆ $static_url_service

StaticURL Services ILIAS\Conditions\Configuration\ConditionTriggerProvider::$static_url_service
private

Definition at line 39 of file ConditionTriggerProvider.php.

◆ $target_obj_id

int ILIAS\Conditions\Configuration\ConditionTriggerProvider::$target_obj_id
private

◆ $target_ref_id

int ILIAS\Conditions\Configuration\ConditionTriggerProvider::$target_ref_id
private

◆ $target_type

string ILIAS\Conditions\Configuration\ConditionTriggerProvider::$target_type
private

◆ $ui_factory

UIFactory ILIAS\Conditions\Configuration\ConditionTriggerProvider::$ui_factory
private

Definition at line 40 of file ConditionTriggerProvider.php.


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