ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilECSCourseMappingRule Class Reference
+ Collaboration diagram for ilECSCourseMappingRule:

Public Member Functions

 __construct (int $a_rid=0)
 
 doMapping ($course, int $parent_ref)
 Do mapping. More...
 
 matches ($course)
 Check if rule matches. 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, $a_sid, $a_mid, $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 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: shib_login.php:25
+ 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 423 of file class.ilECSCourseMappingRule.php.

References getRuleId().

423  : bool
424  {
425  $query = 'DELETE from ecs_cmap_rule ' .
426  'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
427  $this->db->manipulate($query);
428  return true;
429  }
+ 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(), and isSubdirCreationEnabled().

223  : array
224  {
225  if (!$this->isSubdirCreationEnabled()) {
226  return [];
227  }
229 
230  $childs = $this->tree->getChildsByType($parent_ref, 'cat');
231  $category_references = [];
232  foreach ($values as $value) {
233  $found = false;
234  foreach ($childs as $child) {
235  // category already created
236  if (strcmp($child['title'], $value) === 0) {
237  $found = true;
238  $category_references[] = $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, $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 = array();
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 = array();
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: shib_login.php:25
+ Here is the caller graph for this function:

◆ enableFilter()

ilECSCourseMappingRule::enableFilter ( bool  $a_status)

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

Referenced by read().

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

◆ enableSubdirCreation()

ilECSCourseMappingRule::enableSubdirCreation ( bool  $a_stat)

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

Referenced by read().

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

◆ getAttribute()

ilECSCourseMappingRule::getAttribute ( )

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

References $attribute.

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

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

◆ getDirectory()

ilECSCourseMappingRule::getDirectory ( )

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

References $directory.

Referenced by save(), and update().

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

◆ getFilter()

ilECSCourseMappingRule::getFilter ( )

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

References $filter.

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

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

◆ getFilterElements()

ilECSCourseMappingRule::getFilterElements ( )

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

References $filter_elements.

Referenced by matches().

393  : array
394  {
395  return $this->filter_elements;
396  }
+ 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 304 of file class.ilECSCourseMappingRule.php.

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

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

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

◆ getMid()

ilECSCourseMappingRule::getMid ( )

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

References $mid.

Referenced by save().

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

◆ getRefId()

ilECSCourseMappingRule::getRefId ( )

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

References $ref_id.

Referenced by save(), and update().

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

◆ getRuleId()

ilECSCourseMappingRule::getRuleId ( )

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

References $rid.

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

328  : int
329  {
330  return $this->rid;
331  }
+ 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, $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: shib_login.php:25
+ 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, $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: shib_login.php:25
+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseMappingRule::getServerId ( )

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

References $sid.

Referenced by save().

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

◆ getSubDirectoryType()

ilECSCourseMappingRule::getSubDirectoryType ( )

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

Referenced by save(), and update().

408  : int
409  {
410  return self::SUBDIR_VALUE;
411  }
+ 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, 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: shib_login.php:25
+ Here is the caller graph for this function:

◆ isFilterEnabled()

ilECSCourseMappingRule::isFilterEnabled ( )

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

References $is_filter.

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

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

◆ isMatching()

static ilECSCourseMappingRule::isMatching (   $course,
  $a_sid,
  $a_mid,
  $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, $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: shib_login.php:25
+ Here is the caller graph for this function:

◆ isSubdirCreationEnabled()

ilECSCourseMappingRule::isSubdirCreationEnabled ( )

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

References $create_subdir.

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

403  : bool
404  {
405  return $this->create_subdir;
406  }
+ 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 $DIC, $ilDB, $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  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ matches()

ilECSCourseMappingRule::matches (   $course)

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 getAttribute(), ilECSMappingUtils\getCourseValueByMappingAttribute(), getFilterElements(), isFilterEnabled(), and ILIAS\Repository\logger().

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

◆ parseFilter()

ilECSCourseMappingRule::parseFilter ( )
protected

Parse filter.

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

References getFilter().

Referenced by read().

502  : void
503  {
504  $filter = $this->getFilter();
505  //$this->logger->debug('Original filter: ' . $filter);
506 
507  $escaped_filter = str_replace('\,', '#:#', $filter);
508  //$this->logger->debug('Escaped filter: ' . $escaped_filter);
509 
510  $filter_elements = explode(',', $escaped_filter);
511  foreach ((array) $filter_elements as $filter_element) {
512  $replaced = str_replace('#:#', ',', $filter_element);
513  if (trim($replaced) !== '') {
514  $this->filter_elements[] = $replaced;
515  }
516  }
517  //$this->logger->dump($this->filter_elements);
518  }
+ 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 476 of file class.ilECSCourseMappingRule.php.

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

Referenced by __construct().

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

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

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

◆ setAttribute()

ilECSCourseMappingRule::setAttribute ( string  $a_att)

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

Referenced by read().

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

◆ setDirectory()

ilECSCourseMappingRule::setDirectory ( string  $a_dir)

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

Referenced by read().

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

◆ setFilter()

ilECSCourseMappingRule::setFilter ( string  $a_filter)

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

References ILIAS\Repository\filter().

Referenced by read().

383  : void
384  {
385  $this->filter = $a_filter;
386  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ 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 343 of file class.ilECSCourseMappingRule.php.

Referenced by read().

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

◆ setRefId()

ilECSCourseMappingRule::setRefId ( int  $a_ref_id)

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

Referenced by read().

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

◆ setRuleId()

ilECSCourseMappingRule::setRuleId ( int  $a_rule_id)

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

Referenced by save().

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

◆ setServerId()

ilECSCourseMappingRule::setServerId ( int  $a_server_id)

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

Referenced by read().

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

◆ update()

ilECSCourseMappingRule::update ( )

Update mapping rule.

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

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

458  : void
459  {
460  $query = 'UPDATE ecs_cmap_rule ' . ' ' .
461  'SET ' .
462  'attribute = ' . $this->db->quote($this->getAttribute(), 'text') . ', ' .
463  'ref_id = ' . $this->db->quote($this->getRefId(), 'integer') . ', ' .
464  'is_filter = ' . $this->db->quote($this->isFilterEnabled(), 'integer') . ', ' .
465  'filter = ' . $this->db->quote($this->getFilter(), 'text') . ', ' .
466  'create_subdir = ' . $this->db->quote($this->isSubdirCreationEnabled(), 'integer') . ', ' .
467  'subdir_type = ' . $this->db->quote($this->getSubDirectoryType(), 'integer') . ', ' .
468  'directory = ' . $this->db->quote($this->getDirectory(), 'text') . ' ' .
469  'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
470  $this->db->manipulate($query);
471  }
+ 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: