ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSCourseMappingRule Class Reference
+ Collaboration diagram for ilECSCourseMappingRule:

Public Member Functions

 __construct (int $a_rid=0)
 
 doMapping ($course, int $parent_ref)
 Do mapping. More...
 
 setRuleId (int $a_rule_id)
 
 getRuleId ()
 
 setServerId (int $a_server_id)
 
 getServerId ()
 
 setMid (int $a_mid)
 
 getMid ()
 
 setAttribute (string $a_att)
 
 getAttribute ()
 
 setRefId (int $a_ref_id)
 
 getRefId ()
 
 enableFilter (bool $a_status)
 
 isFilterEnabled ()
 
 setFilter (string $a_filter)
 
 getFilter ()
 
 getFilterElements ()
 
 enableSubdirCreation (bool $a_stat)
 
 isSubdirCreationEnabled ()
 
 getSubDirectoryType ()
 
 setDirectory (string $a_dir)
 
 getDirectory ()
 
 delete ()
 
 save ()
 Save a new rule. More...
 
 update ()
 Update mapping rule. More...
 

Static Public Member Functions

static lookupLastExistingAttribute (int $a_sid, int $a_mid, int $a_ref_id)
 Lookup existing attributes. More...
 
static getRuleRefIds (int $a_sid, int $a_mid)
 
static getRulesOfRefId (int $a_sid, int $a_mid, int $a_ref_id)
 Get all rule of ref_id. More...
 
static hasRules (int $a_sid, int $a_mid, int $a_ref_id)
 
static isMatching ($course, int $a_sid, int $a_mid, int $a_ref_id)
 Check if rule matches. More...
 
static doMappings ($course, int $a_sid, int $a_mid, int $a_ref_id)
 
static getInstanceByAttribute ($a_sid, $a_mid, $a_ref_id, $a_att)
 Get rule instance by attribute. More...
 

Data Fields

const SUBDIR_ATTRIBUTE_NAME = 1
 
const SUBDIR_VALUE = 2
 

Protected Member Functions

 createCategory ($a_title, $a_parent_ref)
 Create attribute category. More...
 
 read ()
 Read db entries. More...
 
 parseFilter ()
 Parse filter. More...
 

Private Member Functions

 matches ($course)
 Check if rule matches. More...
 

Private Attributes

ilLogger $logger
 
ilTree $tree
 
ilLanguage $lng
 
ilDBInterface $db
 
int $rid
 
int $sid
 
int $mid
 
string $attribute
 
int $ref_id
 
bool $is_filter = false
 
string $filter = ""
 
array $filter_elements = []
 
bool $create_subdir = true
 
string $directory = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseMappingRule::__construct ( int  $a_rid = 0)

Definition at line 44 of file class.ilECSCourseMappingRule.php.

References $DIC, ILIAS\Repository\lng(), ILIAS\Repository\logger(), and read().

45  {
46  global $DIC;
47 
48  $this->logger = $DIC->logger()->wsrv();
49  $this->tree = $DIC->repositoryTree();
50  $this->lng = $DIC->language();
51  $this->db = $DIC->database();
52 
53  $this->rid = $a_rid;
54  $this->read();
55  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ createCategory()

ilECSCourseMappingRule::createCategory (   $a_title,
  $a_parent_ref 
)
protected

Create attribute category.

Returns
int $ref_id;

Definition at line 253 of file class.ilECSCourseMappingRule.php.

References ILIAS\Repository\lng(), and SYSTEM_USER_ID.

Referenced by doMapping().

253  : int
254  {
255  // Create category
256  $cat = new ilObjCategory();
257  $cat->setOwner(SYSTEM_USER_ID);
258  $cat->setTitle($a_title);
259  $cat->create();
260  $cat->createReference();
261  $cat->putInTree($a_parent_ref);
262  $cat->setPermissions($a_parent_ref);
263  $cat->deleteTranslation($this->lng->getDefaultLanguage());
264  $cat->addTranslation(
265  $a_title,
266  $cat->getLongDescription(),
267  $this->lng->getDefaultLanguage(),
268  $this->lng->getDefaultLanguage()
269  );
270  return $cat->getRefId();
271  }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilECSCourseMappingRule::delete ( )

Definition at line 422 of file class.ilECSCourseMappingRule.php.

References $query, and getRuleId().

422  : bool
423  {
424  $query = 'DELETE from ecs_cmap_rule ' .
425  'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
426  $this->db->manipulate($query);
427  return true;
428  }
$query
+ Here is the call graph for this function:

◆ doMapping()

ilECSCourseMappingRule::doMapping (   $course,
int  $parent_ref 
)

Do mapping.

Definition at line 223 of file class.ilECSCourseMappingRule.php.

References createCategory(), getAttribute(), ilECSMappingUtils\getCourseValueByMappingAttribute(), ILIAS\Repository\int(), and isSubdirCreationEnabled().

223  : array
224  {
225  if (!$this->isSubdirCreationEnabled()) {
226  return [];
227  }
229 
230  $children = $this->tree->getChildsByType($parent_ref, 'cat');
231  $category_references = [];
232  foreach ($values as $value) {
233  $found = false;
234  foreach ($children as $child) {
235  // category already created
236  if (strcmp($child['title'], $value) === 0) {
237  $found = true;
238  $category_references[] = (int) $child['child'];
239  break;
240  }
241  }
242  if (!$found) {
243  $category_references[] = $this->createCategory($value, $parent_ref);
244  }
245  }
246  return $category_references;
247  }
createCategory($a_title, $a_parent_ref)
Create attribute category.
static getCourseValueByMappingAttribute($course, $a_field)
Get course value by mapping.
+ Here is the call graph for this function:

◆ doMappings()

static ilECSCourseMappingRule::doMappings (   $course,
int  $a_sid,
int  $a_mid,
int  $a_ref_id 
)
static

Definition at line 181 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

181  : array
182  {
183  global $DIC;
184 
185  $ilDB = $DIC['ilDB'];
186 
187  $query = 'SELECT rid FROM ecs_cmap_rule ' .
188  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
189  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
190  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
191  'ORDER BY rid';
192  $res = $ilDB->query($query);
193 
194  $level = 1;
195  $last_level_category = [];
196  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
197  $rule = new ilECSCourseMappingRule((int) $row->rid);
198  if ($level === 1) {
199  $last_level_category[] = $rule->getRefId();
200  }
201 
202  $found_new_level = false;
203  $new_level_cats = [];
204  foreach ($last_level_category as $cat_ref_id) {
205  $refs = $rule->doMapping($course, (int) $cat_ref_id);
206  foreach ($refs as $new_ref_id) {
207  $found_new_level = true;
208  $new_level_cats[] = $new_ref_id;
209  }
210  }
211  if ($found_new_level) {
212  $last_level_category = $new_level_cats;
213  }
214  $level++;
215  }
216 
217  return $last_level_category;
218  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ enableFilter()

ilECSCourseMappingRule::enableFilter ( bool  $a_status)

Definition at line 372 of file class.ilECSCourseMappingRule.php.

Referenced by read().

372  : void
373  {
374  $this->is_filter = $a_status;
375  }
+ Here is the caller graph for this function:

◆ enableSubdirCreation()

ilECSCourseMappingRule::enableSubdirCreation ( bool  $a_stat)

Definition at line 397 of file class.ilECSCourseMappingRule.php.

Referenced by read().

397  : void
398  {
399  $this->create_subdir = $a_stat;
400  }
+ Here is the caller graph for this function:

◆ getAttribute()

ilECSCourseMappingRule::getAttribute ( )

Definition at line 357 of file class.ilECSCourseMappingRule.php.

References $attribute.

Referenced by doMapping(), matches(), save(), and update().

357  : string
358  {
359  return $this->attribute;
360  }
+ Here is the caller graph for this function:

◆ getDirectory()

ilECSCourseMappingRule::getDirectory ( )

Definition at line 417 of file class.ilECSCourseMappingRule.php.

References $directory.

Referenced by save(), and update().

417  : string
418  {
419  return $this->directory;
420  }
+ Here is the caller graph for this function:

◆ getFilter()

ilECSCourseMappingRule::getFilter ( )

Definition at line 387 of file class.ilECSCourseMappingRule.php.

References $filter.

Referenced by parseFilter(), save(), and update().

387  : string
388  {
389  return $this->filter;
390  }
+ Here is the caller graph for this function:

◆ getFilterElements()

ilECSCourseMappingRule::getFilterElements ( )

Definition at line 392 of file class.ilECSCourseMappingRule.php.

References $filter_elements.

Referenced by matches().

392  : array
393  {
394  return $this->filter_elements;
395  }
+ Here is the caller graph for this function:

◆ getInstanceByAttribute()

static ilECSCourseMappingRule::getInstanceByAttribute (   $a_sid,
  $a_mid,
  $a_ref_id,
  $a_att 
)
static

Get rule instance by attribute.

Definition at line 303 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingSettingsGUI\cInitMappingForm(), and ilECSMappingSettingsGUI\cSaveOverview().

304  {
305  global $DIC;
306 
307  $ilDB = $DIC['ilDB'];
308 
309  $query = 'SELECT rid FROM ecs_cmap_rule ' .
310  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
311  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
312  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
313  'AND attribute = ' . $ilDB->quote($a_att, 'text');
314 
315  $res = $ilDB->query($query);
316  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
317  return new ilECSCourseMappingRule((int) $row->rid);
318  }
319  return new ilECSCourseMappingRule();
320  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseMappingRule::getMid ( )

Definition at line 347 of file class.ilECSCourseMappingRule.php.

References $mid.

Referenced by save().

347  : int
348  {
349  return $this->mid;
350  }
+ Here is the caller graph for this function:

◆ getRefId()

ilECSCourseMappingRule::getRefId ( )

Definition at line 367 of file class.ilECSCourseMappingRule.php.

References $ref_id.

Referenced by save(), and update().

367  : int
368  {
369  return $this->ref_id;
370  }
+ Here is the caller graph for this function:

◆ getRuleId()

ilECSCourseMappingRule::getRuleId ( )

Definition at line 327 of file class.ilECSCourseMappingRule.php.

References $rid.

Referenced by delete(), read(), save(), and update().

327  : int
328  {
329  return $this->rid;
330  }
+ Here is the caller graph for this function:

◆ getRuleRefIds()

static ilECSCourseMappingRule::getRuleRefIds ( int  $a_sid,
int  $a_mid 
)
static
Returns
int[]

Definition at line 83 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, $ref_id, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilECSCourseCreationHandler\doAttributeMapping(), and ilECSNodeMappingLocalExplorer\initMappings().

83  : array
84  {
85  global $DIC;
86 
87  $ilDB = $DIC['ilDB'];
88 
89  $query = 'SELECT DISTINCT(ref_id) ref_id, rid FROM ecs_cmap_rule ' .
90  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
91  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
92  'GROUP BY ref_id' . ' ' .
93  'ORDER BY rid';
94 
95  $res = $ilDB->query($query);
96  $ref_ids = array();
97  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
98  $ref_ids[] = (int) $row->ref_id;
99  }
100  // check if ref_ids are in tree
101  $checked_ref_ids = [];
102  foreach ($ref_ids as $ref_id) {
103  if (
104  $DIC->repositoryTree()->isInTree($ref_id)) {
105  $checked_ref_ids[] = $ref_id;
106  }
107  }
108  return $checked_ref_ids;
109  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRulesOfRefId()

static ilECSCourseMappingRule::getRulesOfRefId ( int  $a_sid,
int  $a_mid,
int  $a_ref_id 
)
static

Get all rule of ref_id.

Returns
int[]

Definition at line 115 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingSettingsGUI\cDeleteRulesOfNode().

115  : array
116  {
117  global $DIC;
118 
119  $ilDB = $DIC['ilDB'];
120 
121  $query = 'SELECT rid FROM ecs_cmap_rule ' .
122  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
123  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
124  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
125  $res = $ilDB->query($query);
126  $rids = [];
127  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
128  $rids = $row->rid;
129  }
130  return $rids;
131  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseMappingRule::getServerId ( )

Definition at line 337 of file class.ilECSCourseMappingRule.php.

References $sid.

Referenced by save().

337  : int
338  {
339  return $this->sid;
340  }
+ Here is the caller graph for this function:

◆ getSubDirectoryType()

ilECSCourseMappingRule::getSubDirectoryType ( )

Definition at line 407 of file class.ilECSCourseMappingRule.php.

Referenced by save(), and update().

407  : int
408  {
409  return self::SUBDIR_VALUE;
410  }
+ Here is the caller graph for this function:

◆ hasRules()

static ilECSCourseMappingRule::hasRules ( int  $a_sid,
int  $a_mid,
int  $a_ref_id 
)
static

Definition at line 133 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilECSMappingSettingsGUI\cInitMappingForm().

133  : bool
134  {
135  global $DIC;
136 
137  $ilDB = $DIC['ilDB'];
138 
139  $query = 'SELECT ref_id FROM ecs_cmap_rule ' .
140  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
141  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
142  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
143  $res = $ilDB->query($query);
144  return $res->numRows() ? true : false;
145  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ isFilterEnabled()

ilECSCourseMappingRule::isFilterEnabled ( )

Definition at line 377 of file class.ilECSCourseMappingRule.php.

References $is_filter.

Referenced by matches(), save(), and update().

377  : bool
378  {
379  return $this->is_filter;
380  }
+ Here is the caller graph for this function:

◆ isMatching()

static ilECSCourseMappingRule::isMatching (   $course,
int  $a_sid,
int  $a_mid,
int  $a_ref_id 
)
static

Check if rule matches.

Returns
string 0 if not matches; otherwise rule_id_index
See also
matches

Definition at line 151 of file class.ilECSCourseMappingRule.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

151  : string
152  {
153  global $DIC;
154 
155  $ilDB = $DIC['ilDB'];
156 
157  $query = 'SELECT rid FROM ecs_cmap_rule ' .
158  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
159  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
160  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
161  'ORDER BY rid';
162  $res = $ilDB->query($query);
163 
164  $does_match = false;
165  $sortable_index = '';
166  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
167  $rule = new ilECSCourseMappingRule((int) $row->rid);
168  $matches = $rule->matches($course);
169  if ($matches === -1) {
170  return '0';
171  }
172  $does_match = true;
173  $sortable_index .= str_pad((string) $matches, 4, '0', STR_PAD_LEFT);
174  }
175  if ($does_match) {
176  return $sortable_index;
177  }
178  return "0";
179  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ isSubdirCreationEnabled()

ilECSCourseMappingRule::isSubdirCreationEnabled ( )

Definition at line 402 of file class.ilECSCourseMappingRule.php.

References $create_subdir.

Referenced by doMapping(), save(), and update().

402  : bool
403  {
404  return $this->create_subdir;
405  }
+ Here is the caller graph for this function:

◆ lookupLastExistingAttribute()

static ilECSCourseMappingRule::lookupLastExistingAttribute ( int  $a_sid,
int  $a_mid,
int  $a_ref_id 
)
static

Lookup existing attributes.

Definition at line 60 of file class.ilECSCourseMappingRule.php.

References $attributes, $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingSettingsGUI\cInitOverview().

60  : string
61  {
62  global $DIC;
63 
64  $ilDB = $DIC['ilDB'];
65 
66  $query = 'SELECT attribute FROM ecs_cmap_rule ' .
67  'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
68  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
69  'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
70  'ORDER BY rid ';
71  $res = $ilDB->query($query);
72 
73  $attributes = '';
74  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
75  $attributes = $row->attribute;
76  }
77  return $attributes;
78  }
$attributes
Definition: metadata.php:248
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ matches()

ilECSCourseMappingRule::matches (   $course)
private

Check if rule matches.

Returns
int -1 does not match, 0 matches with disabled filter, >0 matches xth index in course attribute value.

Definition at line 278 of file class.ilECSCourseMappingRule.php.

References $index, getAttribute(), ilECSMappingUtils\getCourseValueByMappingAttribute(), getFilterElements(), isFilterEnabled(), and ILIAS\Repository\logger().

278  : int
279  {
280  if ($this->isFilterEnabled()) {
282  $index = 0;
283  foreach ($values as $value) {
284  $index++;
285  foreach ($this->getFilterElements() as $filter_element) {
286  $this->logger->debug('Comparing ' . $value . ' with ' . $filter_element);
287  if (strcmp(trim($value), trim($filter_element)) === 0) {
288  $this->logger->debug($value . ' matches ' . $filter_element);
289  $this->logger->debug('Found index: ' . $index);
290  return $index;
291  }
292  }
293  }
294  return -1;
295  }
296  return 0;
297  }
static getCourseValueByMappingAttribute($course, $a_field)
Get course value by mapping.
$index
Definition: metadata.php:145
+ Here is the call graph for this function:

◆ parseFilter()

ilECSCourseMappingRule::parseFilter ( )
protected

Parse filter.

Definition at line 501 of file class.ilECSCourseMappingRule.php.

References getFilter().

Referenced by read().

501  : void
502  {
503  $filter = $this->getFilter();
504  //$this->logger->debug('Original filter: ' . $filter);
505 
506  $escaped_filter = str_replace('\,', '#:#', $filter);
507  //$this->logger->debug('Escaped filter: ' . $escaped_filter);
508 
509  $filter_elements = explode(',', $escaped_filter);
510  foreach ((array) $filter_elements as $filter_element) {
511  $replaced = str_replace('#:#', ',', $filter_element);
512  if (trim($replaced) !== '') {
513  $this->filter_elements[] = $replaced;
514  }
515  }
516  //$this->logger->dump($this->filter_elements);
517  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilECSCourseMappingRule::read ( )
protected

Read db entries.

Definition at line 475 of file class.ilECSCourseMappingRule.php.

References $query, $res, enableFilter(), enableSubdirCreation(), ilDBConstants\FETCHMODE_OBJECT, getRuleId(), parseFilter(), setAttribute(), setDirectory(), setFilter(), setMid(), setRefId(), and setServerId().

Referenced by __construct().

475  : void
476  {
477  if (!$this->getRuleId()) {
478  return;
479  }
480  $query = 'SELECT * from ecs_cmap_rule ' . ' ' .
481  'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
482  $res = $this->db->query($query);
483  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
484  $this->setServerId((int) $row->sid);
485  $this->setMid((int) $row->mid);
486  $this->setRefId((int) $row->ref_id);
487  $this->setAttribute($row->attribute);
488  $this->enableFilter((bool) $row->is_filter);
489  $this->setFilter($row->filter);
490  $this->enableSubdirCreation((bool) $row->create_subdir);
491  //TODO create database update step to remove unneed variable
492  $this->setDirectory($row->directory);
493  }
494 
495  $this->parseFilter();
496  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSCourseMappingRule::save ( )

Save a new rule.

Definition at line 433 of file class.ilECSCourseMappingRule.php.

References $query, getAttribute(), getDirectory(), getFilter(), getMid(), getRefId(), getRuleId(), getServerId(), getSubDirectoryType(), isFilterEnabled(), isSubdirCreationEnabled(), and setRuleId().

433  : int
434  {
435  $this->setRuleId($this->db->nextId('ecs_cmap_rule'));
436  $query = 'INSERT INTO ecs_cmap_rule ' .
437  '(rid,sid,mid,attribute,ref_id,is_filter,filter,create_subdir,subdir_type,directory) ' .
438  'VALUES (' .
439  $this->db->quote($this->getRuleId(), 'integer') . ', ' .
440  $this->db->quote($this->getServerId(), 'integer') . ', ' .
441  $this->db->quote($this->getMid(), 'integer') . ', ' .
442  $this->db->quote($this->getAttribute(), 'text') . ', ' .
443  $this->db->quote($this->getRefId(), 'integer') . ', ' .
444  $this->db->quote($this->isFilterEnabled(), 'integer') . ', ' .
445  $this->db->quote($this->getFilter(), 'text') . ', ' .
446  $this->db->quote($this->isSubdirCreationEnabled(), 'integer') . ', ' .
447  $this->db->quote($this->getSubDirectoryType(), 'integer') . ', ' .
448  $this->db->quote($this->getDirectory(), 'text') . ' ' .
449  ')';
450  $this->db->manipulate($query);
451  return $this->getRuleId();
452  }
$query
+ Here is the call graph for this function:

◆ setAttribute()

ilECSCourseMappingRule::setAttribute ( string  $a_att)

Definition at line 352 of file class.ilECSCourseMappingRule.php.

Referenced by read().

352  : void
353  {
354  $this->attribute = $a_att;
355  }
+ Here is the caller graph for this function:

◆ setDirectory()

ilECSCourseMappingRule::setDirectory ( string  $a_dir)

Definition at line 412 of file class.ilECSCourseMappingRule.php.

Referenced by read().

412  : void
413  {
414  $this->directory = $a_dir;
415  }
+ Here is the caller graph for this function:

◆ setFilter()

ilECSCourseMappingRule::setFilter ( string  $a_filter)

Definition at line 382 of file class.ilECSCourseMappingRule.php.

References ILIAS\UI\examples\Symbol\Glyph\Filter\filter().

Referenced by read().

382  : void
383  {
384  $this->filter = $a_filter;
385  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMid()

ilECSCourseMappingRule::setMid ( int  $a_mid)

Definition at line 342 of file class.ilECSCourseMappingRule.php.

Referenced by read().

342  : void
343  {
344  $this->mid = $a_mid;
345  }
+ Here is the caller graph for this function:

◆ setRefId()

ilECSCourseMappingRule::setRefId ( int  $a_ref_id)

Definition at line 362 of file class.ilECSCourseMappingRule.php.

Referenced by read().

362  : void
363  {
364  $this->ref_id = $a_ref_id;
365  }
+ Here is the caller graph for this function:

◆ setRuleId()

ilECSCourseMappingRule::setRuleId ( int  $a_rule_id)

Definition at line 322 of file class.ilECSCourseMappingRule.php.

Referenced by save().

322  : void
323  {
324  $this->rid = $a_rule_id;
325  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseMappingRule::setServerId ( int  $a_server_id)

Definition at line 332 of file class.ilECSCourseMappingRule.php.

Referenced by read().

332  : void
333  {
334  $this->sid = $a_server_id;
335  }
+ Here is the caller graph for this function:

◆ update()

ilECSCourseMappingRule::update ( )

Update mapping rule.

Definition at line 457 of file class.ilECSCourseMappingRule.php.

References $query, getAttribute(), getDirectory(), getFilter(), getRefId(), getRuleId(), getSubDirectoryType(), isFilterEnabled(), and isSubdirCreationEnabled().

457  : void
458  {
459  $query = 'UPDATE ecs_cmap_rule ' . ' ' .
460  'SET ' .
461  'attribute = ' . $this->db->quote($this->getAttribute(), 'text') . ', ' .
462  'ref_id = ' . $this->db->quote($this->getRefId(), 'integer') . ', ' .
463  'is_filter = ' . $this->db->quote($this->isFilterEnabled(), 'integer') . ', ' .
464  'filter = ' . $this->db->quote($this->getFilter(), 'text') . ', ' .
465  'create_subdir = ' . $this->db->quote($this->isSubdirCreationEnabled(), 'integer') . ', ' .
466  'subdir_type = ' . $this->db->quote($this->getSubDirectoryType(), 'integer') . ', ' .
467  'directory = ' . $this->db->quote($this->getDirectory(), 'text') . ' ' .
468  'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
469  $this->db->manipulate($query);
470  }
$query
+ Here is the call graph for this function:

Field Documentation

◆ $attribute

string ilECSCourseMappingRule::$attribute
private

Definition at line 36 of file class.ilECSCourseMappingRule.php.

Referenced by getAttribute().

◆ $create_subdir

bool ilECSCourseMappingRule::$create_subdir = true
private

Definition at line 41 of file class.ilECSCourseMappingRule.php.

Referenced by isSubdirCreationEnabled().

◆ $db

ilDBInterface ilECSCourseMappingRule::$db
private

Definition at line 31 of file class.ilECSCourseMappingRule.php.

◆ $directory

string ilECSCourseMappingRule::$directory = ''
private

Definition at line 42 of file class.ilECSCourseMappingRule.php.

Referenced by getDirectory().

◆ $filter

string ilECSCourseMappingRule::$filter = ""
private

Definition at line 39 of file class.ilECSCourseMappingRule.php.

Referenced by getFilter().

◆ $filter_elements

array ilECSCourseMappingRule::$filter_elements = []
private

Definition at line 40 of file class.ilECSCourseMappingRule.php.

Referenced by getFilterElements().

◆ $is_filter

bool ilECSCourseMappingRule::$is_filter = false
private

Definition at line 38 of file class.ilECSCourseMappingRule.php.

Referenced by isFilterEnabled().

◆ $lng

ilLanguage ilECSCourseMappingRule::$lng
private

Definition at line 30 of file class.ilECSCourseMappingRule.php.

◆ $logger

ilLogger ilECSCourseMappingRule::$logger
private

Definition at line 28 of file class.ilECSCourseMappingRule.php.

◆ $mid

int ilECSCourseMappingRule::$mid
private

Definition at line 35 of file class.ilECSCourseMappingRule.php.

Referenced by getMid().

◆ $ref_id

int ilECSCourseMappingRule::$ref_id
private

Definition at line 37 of file class.ilECSCourseMappingRule.php.

Referenced by getRefId(), and getRuleRefIds().

◆ $rid

int ilECSCourseMappingRule::$rid
private

Definition at line 33 of file class.ilECSCourseMappingRule.php.

Referenced by getRuleId().

◆ $sid

int ilECSCourseMappingRule::$sid
private

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

Referenced by getServerId().

◆ $tree

ilTree ilECSCourseMappingRule::$tree
private

Definition at line 29 of file class.ilECSCourseMappingRule.php.

◆ SUBDIR_ATTRIBUTE_NAME

const ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME = 1

Definition at line 25 of file class.ilECSCourseMappingRule.php.

◆ SUBDIR_VALUE

const ilECSCourseMappingRule::SUBDIR_VALUE = 2

Definition at line 26 of file class.ilECSCourseMappingRule.php.


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