ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 45 of file class.ilECSCourseMappingRule.php.

46 {
47 global $DIC;
48
49 $this->logger = $DIC->logger()->wsrv();
50 $this->tree = $DIC->repositoryTree();
51 $this->lng = $DIC->language();
52 $this->db = $DIC->database();
53
54 $this->rid = $a_rid;
55 $this->read();
56 }
global $DIC
Definition: shib_login.php:26

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

+ 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 254 of file class.ilECSCourseMappingRule.php.

254 : int
255 {
256 // Create category
257 $cat = new ilObjCategory();
258 $cat->setOwner(SYSTEM_USER_ID);
259 $cat->setTitle($a_title);
260 $cat->create();
261 $cat->createReference();
262 $cat->putInTree($a_parent_ref);
263 $cat->setPermissions($a_parent_ref);
264 $cat->deleteTranslation($this->lng->getDefaultLanguage());
265 $cat->addTranslation(
266 $a_title,
267 $cat->getLongDescription(),
268 $this->lng->getDefaultLanguage(),
269 $this->lng->getDefaultLanguage()
270 );
271 return $cat->getRefId();
272 }
Class ilObjCategory.
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26

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

Referenced by doMapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilECSCourseMappingRule::delete ( )

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

424 : bool
425 {
426 $query = 'DELETE from ecs_cmap_rule ' .
427 'WHERE rid = ' . $this->db->quote($this->getRuleId(), 'integer');
428 $this->db->manipulate($query);
429 return true;
430 }

References getRuleId().

+ Here is the call graph for this function:

◆ doMapping()

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

Do mapping.

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

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

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

+ 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 182 of file class.ilECSCourseMappingRule.php.

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

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

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

+ Here is the caller graph for this function:

◆ enableFilter()

ilECSCourseMappingRule::enableFilter ( bool  $a_status)

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

374 : void
375 {
376 $this->is_filter = $a_status;
377 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableSubdirCreation()

ilECSCourseMappingRule::enableSubdirCreation ( bool  $a_stat)

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

399 : void
400 {
401 $this->create_subdir = $a_stat;
402 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttribute()

ilECSCourseMappingRule::getAttribute ( )

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

359 : string
360 {
361 return $this->attribute;
362 }

References $attribute.

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

+ Here is the caller graph for this function:

◆ getDirectory()

ilECSCourseMappingRule::getDirectory ( )

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

419 : string
420 {
421 return $this->directory;
422 }

References $directory.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getFilter()

ilECSCourseMappingRule::getFilter ( )

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

389 : string
390 {
391 return $this->filter;
392 }

References $filter.

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

+ Here is the caller graph for this function:

◆ getFilterElements()

ilECSCourseMappingRule::getFilterElements ( )

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

394 : array
395 {
397 }

References $filter_elements.

Referenced by matches().

+ 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 305 of file class.ilECSCourseMappingRule.php.

306 {
307 global $DIC;
308
309 $ilDB = $DIC['ilDB'];
310
311 $query = 'SELECT rid FROM ecs_cmap_rule ' .
312 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
313 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
314 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
315 'AND attribute = ' . $ilDB->quote($a_att, 'text');
316
317 $res = $ilDB->query($query);
318 if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
319 return new ilECSCourseMappingRule((int) $row->rid);
320 }
321 return new ilECSCourseMappingRule();
322 }

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

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

+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseMappingRule::getMid ( )

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

349 : int
350 {
351 return $this->mid;
352 }

References $mid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getRefId()

ilECSCourseMappingRule::getRefId ( )

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

369 : int
370 {
371 return $this->ref_id;
372 }

References $ref_id.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getRuleId()

ilECSCourseMappingRule::getRuleId ( )

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

329 : int
330 {
331 return $this->rid;
332 }

References $rid.

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

+ Here is the caller graph for this function:

◆ getRuleRefIds()

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

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

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

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

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

+ 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 116 of file class.ilECSCourseMappingRule.php.

116 : array
117 {
118 global $DIC;
119
120 $ilDB = $DIC['ilDB'];
121
122 $query = 'SELECT rid FROM ecs_cmap_rule ' .
123 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
124 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
125 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
126 $res = $ilDB->query($query);
127 $rids = [];
128 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
129 $rids = $row->rid;
130 }
131 return $rids;
132 }

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

Referenced by ilECSMappingSettingsGUI\cDeleteRulesOfNode().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseMappingRule::getServerId ( )

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

339 : int
340 {
341 return $this->sid;
342 }

References $sid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getSubDirectoryType()

ilECSCourseMappingRule::getSubDirectoryType ( )

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

409 : int
410 {
411 return self::SUBDIR_VALUE;
412 }

References SUBDIR_VALUE.

Referenced by save(), and update().

+ 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 134 of file class.ilECSCourseMappingRule.php.

134 : bool
135 {
136 global $DIC;
137
138 $ilDB = $DIC['ilDB'];
139
140 $query = 'SELECT ref_id FROM ecs_cmap_rule ' .
141 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
142 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
143 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
144 $res = $ilDB->query($query);
145 return $res->numRows() ? true : false;
146 }
return true

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

Referenced by ilECSMappingSettingsGUI\cInitMappingForm().

+ Here is the caller graph for this function:

◆ isFilterEnabled()

ilECSCourseMappingRule::isFilterEnabled ( )

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

379 : bool
380 {
381 return $this->is_filter;
382 }

References $is_filter.

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

+ 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 152 of file class.ilECSCourseMappingRule.php.

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

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

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

+ Here is the caller graph for this function:

◆ isSubdirCreationEnabled()

ilECSCourseMappingRule::isSubdirCreationEnabled ( )

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

404 : bool
405 {
407 }

References $create_subdir.

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

+ 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 61 of file class.ilECSCourseMappingRule.php.

61 : string
62 {
63 global $DIC;
64
65 $ilDB = $DIC['ilDB'];
66
67 $query = 'SELECT attribute FROM ecs_cmap_rule ' .
68 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
69 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
70 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
71 'ORDER BY rid ';
72 $res = $ilDB->query($query);
73
74 $attributes = '';
75 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
76 $attributes = $row->attribute;
77 }
78 return $attributes;
79 }

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

Referenced by ilECSMappingSettingsGUI\cInitOverview().

+ 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 279 of file class.ilECSCourseMappingRule.php.

279 : int
280 {
281 if ($this->isFilterEnabled()) {
283 $this->logger->dump($values);
284 $index = 0;
285 foreach ($values as $value) {
286 $index++;
287 foreach ($this->getFilterElements() as $filter_element) {
288 $this->logger->debug('Comparing ' . $value . ' with ' . $filter_element);
289 if (strcmp(trim($value), trim($filter_element)) === 0) {
290 $this->logger->debug($value . ' matches ' . $filter_element);
291 $this->logger->debug('Found index: ' . $index);
292 return $index;
293 }
294 }
295 }
296 return -1;
297 }
298 return 0;
299 }

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

+ Here is the call graph for this function:

◆ parseFilter()

ilECSCourseMappingRule::parseFilter ( )
protected

Parse filter.

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

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

References $filter, $filter_elements, and getFilter().

Referenced by read().

+ 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 477 of file class.ilECSCourseMappingRule.php.

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

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

Referenced by __construct().

+ 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 435 of file class.ilECSCourseMappingRule.php.

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

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

+ Here is the call graph for this function:

◆ setAttribute()

ilECSCourseMappingRule::setAttribute ( string  $a_att)

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

354 : void
355 {
356 $this->attribute = $a_att;
357 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDirectory()

ilECSCourseMappingRule::setDirectory ( string  $a_dir)

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

414 : void
415 {
416 $this->directory = $a_dir;
417 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setFilter()

ilECSCourseMappingRule::setFilter ( string  $a_filter)

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

384 : void
385 {
386 $this->filter = $a_filter;
387 }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)

References ILIAS\Repository\filter().

Referenced by read().

+ 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 344 of file class.ilECSCourseMappingRule.php.

344 : void
345 {
346 $this->mid = $a_mid;
347 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRefId()

ilECSCourseMappingRule::setRefId ( int  $a_ref_id)

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

364 : void
365 {
366 $this->ref_id = $a_ref_id;
367 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRuleId()

ilECSCourseMappingRule::setRuleId ( int  $a_rule_id)

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

324 : void
325 {
326 $this->rid = $a_rule_id;
327 }

Referenced by save().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseMappingRule::setServerId ( int  $a_server_id)

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

334 : void
335 {
336 $this->sid = $a_server_id;
337 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilECSCourseMappingRule::update ( )

Update mapping rule.

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

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

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

+ Here is the call graph for this function:

Field Documentation

◆ $attribute

string ilECSCourseMappingRule::$attribute
private

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

Referenced by getAttribute().

◆ $create_subdir

bool ilECSCourseMappingRule::$create_subdir = true
private

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

Referenced by isSubdirCreationEnabled().

◆ $db

ilDBInterface ilECSCourseMappingRule::$db
private

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

◆ $directory

string ilECSCourseMappingRule::$directory = ''
private

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

Referenced by getDirectory().

◆ $filter

string ilECSCourseMappingRule::$filter = ""
private

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

Referenced by getFilter(), and parseFilter().

◆ $filter_elements

array ilECSCourseMappingRule::$filter_elements = []
private

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

Referenced by getFilterElements(), and parseFilter().

◆ $is_filter

bool ilECSCourseMappingRule::$is_filter = false
private

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

Referenced by isFilterEnabled().

◆ $lng

ilLanguage ilECSCourseMappingRule::$lng
private

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

◆ $logger

ilLogger ilECSCourseMappingRule::$logger
private

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

◆ $mid

int ilECSCourseMappingRule::$mid
private

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

Referenced by getMid().

◆ $ref_id

int ilECSCourseMappingRule::$ref_id
private

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

Referenced by getRefId(), and getRuleRefIds().

◆ $rid

int ilECSCourseMappingRule::$rid
private

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

Referenced by getRuleId().

◆ $sid

int ilECSCourseMappingRule::$sid
private

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

Referenced by getServerId().

◆ $tree

ilTree ilECSCourseMappingRule::$tree
private

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

◆ SUBDIR_ATTRIBUTE_NAME

const ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME = 1

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

◆ SUBDIR_VALUE

const ilECSCourseMappingRule::SUBDIR_VALUE = 2

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

Referenced by getSubDirectoryType().


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