ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSCourseMappingRule Class Reference

Description of class. More...

+ Collaboration diagram for ilECSCourseMappingRule:

Public Member Functions

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

Static Public Member Functions

static lookupLastExistingAttribute ($a_sid, $a_mid, $a_ref_id)
 Lookup existing attributes. More...
 
static getRuleRefIds ($a_sid, $a_mid)
 
static getRulesOfRefId ($a_sid, $a_mid, $a_ref_id)
 Get all rule of ref_id @global type $ilDB. More...
 
static hasRules ($a_sid, $a_mid, $a_ref_id)
 
static isMatching ($course, $a_sid, $a_mid, $a_ref_id)
 Check if rule matches. More...
 
static doMappings ($course, $a_sid, $a_mid, $a_ref_id)
 
static getInstanceByAttribute ($a_sid, $a_mid, $a_ref_id, $a_att)
 Get rule instance by attribute @global type $ilDB. 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

 $rid
 
 $sid
 
 $mid
 
 $attribute
 
 $ref_id
 
 $is_filter = false
 
 $filter
 
 $filter_elements = []
 
 $create_subdir = true
 
 $subdir_type = self::SUBDIR_VALUE
 
 $directory = ''
 
 $logger = null
 

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseMappingRule::__construct (   $a_rid = 0)

Constructor.

Parameters
int$a_rid

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

37 {
38 $this->logger = $GLOBALS['DIC']->logger()->wsrv();
39 $this->rid = $a_rid;
40 $this->read();
41 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, 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 249 of file class.ilECSCourseMappingRule.php.

250 {
251 // Create category
252 include_once './Modules/Category/classes/class.ilObjCategory.php';
253 $cat = new ilObjCategory();
254 $cat->setOwner(SYSTEM_USER_ID);
255 $cat->setTitle($a_title);
256 $cat->create();
257 $cat->createReference();
258 $cat->putInTree($a_parent_ref);
259 $cat->setPermissions($a_parent_ref);
260 $cat->deleteTranslation($GLOBALS['lng']->getDefaultLanguage());
261 $cat->addTranslation(
262 $a_title,
263 $cat->getLongDescription(),
264 $GLOBALS['lng']->getDefaultLanguage(),
265 1
266 );
267 return $cat->getRefId();
268 }
Class ilObjCategory.

References $GLOBALS.

Referenced by doMapping().

+ Here is the caller graph for this function:

◆ delete()

ilECSCourseMappingRule::delete ( )

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

432 {
433 global $ilDB;
434
435 $query = 'DELETE from ecs_cmap_rule ' .
436 'WHERE rid = ' . $ilDB->quote($this->getRuleId(), 'integer');
437 $ilDB->manipulate($query);
438 return true;
439 }
$query
global $ilDB

References $ilDB, $query, and getRuleId().

+ Here is the call graph for this function:

◆ doMapping()

ilECSCourseMappingRule::doMapping (   $course,
  $parent_ref 
)

Do mapping.

Parameters
type$course
type$parent_ref

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

218 {
219 global $tree;
220
221 if (!$this->isSubdirCreationEnabled()) {
222 return array();
223 }
224 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
226
227 $childs = $tree->getChildsByType($parent_ref, 'cat');
228 foreach ($values as $value) {
229 $found = false;
230 foreach ((array) $childs as $child) {
231 // category already created
232 if (strcmp($child['title'], $value) === 0) {
233 $found = true;
234 $category_references[] = $child['child'];
235 break;
236 }
237 }
238 if (!$found) {
239 $category_references[] = $this->createCategory($value, $parent_ref);
240 }
241 }
242 return (array) $category_references;
243 }
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,
  $a_sid,
  $a_mid,
  $a_ref_id 
)
static
Parameters
type$course
type$a_sid
type$a_mid
type$a_ref_id
Returns
array

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

176 {
177 global $ilDB;
178
179 $query = 'SELECT rid FROM ecs_cmap_rule ' .
180 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
181 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
182 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
183 'ORDER BY rid';
184 $res = $ilDB->query($query);
185
186 $level = 1;
187 $last_level_category = array();
188 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
190 if ($level == 1) {
191 $last_level_category[] = $rule->getRefId();
192 }
193
194 $found_new_level = false;
195 $new_level_cats = array();
196 foreach ((array) $last_level_category as $cat_ref_id) {
197 $refs = $rule->doMapping($course, $cat_ref_id);
198 foreach ($refs as $new_ref_id) {
199 $found_new_level = true;
200 $new_level_cats[] = $new_ref_id;
201 }
202 }
203 if ($found_new_level) {
204 $last_level_category = $new_level_cats;
205 }
206 $level++;
207 }
208
209 return (array) $last_level_category;
210 }
foreach($_POST as $key=> $value) $res
$rule
Definition: showstats.php:43

References $ilDB, $query, $res, $row, $rule, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

+ Here is the caller graph for this function:

◆ enableFilter()

ilECSCourseMappingRule::enableFilter (   $a_status)

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

377 {
378 $this->is_filter = $a_status;
379 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableSubdirCreation()

ilECSCourseMappingRule::enableSubdirCreation (   $a_stat)

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

402 {
403 $this->create_subdir = $a_stat;
404 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttribute()

ilECSCourseMappingRule::getAttribute ( )

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

References $attribute.

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

+ Here is the caller graph for this function:

◆ getDirectory()

ilECSCourseMappingRule::getDirectory ( )

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

References $directory.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getFilter()

ilECSCourseMappingRule::getFilter ( )

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

References $filter.

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

+ Here is the caller graph for this function:

◆ getFilterElements()

ilECSCourseMappingRule::getFilterElements ( )

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

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 @global type $ilDB.

Parameters
type$a_sid
type$a_mid
type$a_ref_id
type$a_att
Returns
\ilECSCourseMappingRule

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

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

References $ilDB, $query, $res, $row, 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 351 of file class.ilECSCourseMappingRule.php.

References $mid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getRefId()

ilECSCourseMappingRule::getRefId ( )

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

References $ref_id.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getRuleId()

ilECSCourseMappingRule::getRuleId ( )

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

References $rid.

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

+ Here is the caller graph for this function:

◆ getRuleRefIds()

static ilECSCourseMappingRule::getRuleRefIds (   $a_sid,
  $a_mid 
)
static
Parameters
type$a_sid
type$a_mid

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

72 {
73 global $ilDB;
74
75 $query = 'SELECT DISTINCT(ref_id) ref_id, rid FROM ecs_cmap_rule ' .
76 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
77 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
78 'GROUP BY ref_id' . ' ' .
79 'ORDER BY rid';
80
81 $res = $ilDB->query($query);
82 $ref_ids = array();
83 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
84 $ref_ids[] = $row->ref_id;
85 }
86 // check if ref_ids are in tree
87 $checked_ref_ids = [];
88 foreach ($ref_ids as $ref_id) {
89 if (
90 $GLOBALS['DIC']->repositoryTree()->isInTree($ref_id)) {
91 $checked_ref_ids[] = $ref_id;
92 }
93 }
94 return $checked_ref_ids;
95 }

References $GLOBALS, $ilDB, $query, $ref_id, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

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

+ Here is the caller graph for this function:

◆ getRulesOfRefId()

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

Get all rule of ref_id @global type $ilDB.

Parameters
type$a_sid
type$a_mid
type$a_ref_id
Returns
int[]

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

106 {
107 global $ilDB;
108
109 $query = 'SELECT rid FROM ecs_cmap_rule ' .
110 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
111 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
112 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
113 $res = $ilDB->query($query);
114 $rids = array();
115 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
116 $rids = $row->rid;
117 }
118 return (array) $rids;
119 }

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

Referenced by ilECSMappingSettingsGUI\cDeleteRulesOfNode().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseMappingRule::getServerId ( )

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

References $sid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getSubDirectoryType()

ilECSCourseMappingRule::getSubDirectoryType ( )

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

References SUBDIR_VALUE.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasRules()

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

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

122 {
123 global $ilDB;
124
125 $query = 'SELECT ref_id FROM ecs_cmap_rule ' .
126 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
127 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
128 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer');
129 $res = $ilDB->query($query);
130 return $res->numRows() ? true : false;
131 }

References $ilDB, $query, and $res.

Referenced by ilECSMappingSettingsGUI\cInitMappingForm().

+ Here is the caller graph for this function:

◆ isFilterEnabled()

ilECSCourseMappingRule::isFilterEnabled ( )

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

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.

Parameters
type$course
type$a_start_rule_id
Returns
string 0 if not matches; otherwise rule_id_index
See also
matches

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

140 {
141 global $ilDB;
142
143 $query = 'SELECT rid FROM ecs_cmap_rule ' .
144 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
145 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
146 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
147 'ORDER BY rid';
148 $res = $ilDB->query($query);
149
150 $does_match = false;
151 $sortable_index = '';
152 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
154 $matches = $rule->matches($course);
155 if ($matches == -1) {
156 return '0';
157 }
158 $does_match = true;
159 $sortable_index .= str_pad($matches, 4, '0', STR_PAD_LEFT);
160 }
161 if ($does_match) {
162 return $sortable_index;
163 }
164 return "0";
165 }

References $ilDB, $query, $res, $row, $rule, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

+ Here is the caller graph for this function:

◆ isSubdirCreationEnabled()

ilECSCourseMappingRule::isSubdirCreationEnabled ( )

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

References $create_subdir.

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

+ Here is the caller graph for this function:

◆ lookupLastExistingAttribute()

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

Lookup existing attributes.

Parameters
type$a_attributes
Returns
array

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

49 {
50 global $ilDB;
51
52 $query = 'SELECT attribute FROM ecs_cmap_rule ' .
53 'WHERE sid = ' . $ilDB->quote($a_sid, 'integer') . ' ' .
54 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
55 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ' .
56 'ORDER BY rid ';
57 $res = $ilDB->query($query);
58
59 $attributes = array();
60 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
61 $attributes = $row->attribute;
62 }
63 return $attributes;
64 }
$attributes

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

Referenced by ilECSMappingSettingsGUI\cInitOverview().

+ Here is the caller graph for this function:

◆ matches()

ilECSCourseMappingRule::matches (   $course)

Check if rule matches.

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

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

277 {
278 if ($this->isFilterEnabled()) {
279 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
281 $this->logger->dump($values);
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 }
$index
Definition: metadata.php:60

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

+ Here is the call graph for this function:

◆ parseFilter()

ilECSCourseMappingRule::parseFilter ( )
protected

Parse filter.

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

522 {
523 $filter = $this->getFilter();
524 //$this->logger->debug('Original filter: ' . $filter);
525
526 $escaped_filter = str_replace('\,', '#:#', $filter);
527 //$this->logger->debug('Escaped filter: ' . $escaped_filter);
528
529 $filter_elements = explode(',', $escaped_filter);
530 foreach ((array) $filter_elements as $filter_element) {
531 $replaced = str_replace('#:#', ',', $filter_element);
532 if (strlen(trim($replaced))) {
533 $this->filter_elements[] = $replaced;
534 }
535 }
536 //$this->logger->dump($this->filter_elements);
537 }

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

494 {
495 global $ilDB;
496
497 if (!$this->getRuleId()) {
498 return true;
499 }
500 $query = 'SELECT * from ecs_cmap_rule ' . ' ' .
501 'WHERE rid = ' . $ilDB->quote($this->getRuleId(), 'integer');
502 $res = $ilDB->query($query);
503 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
504 $this->setServerId($row->sid);
505 $this->setMid($row->mid);
506 $this->setRefId($row->ref_id);
507 $this->setAttribute($row->attribute);
508 $this->enableFilter($row->is_filter);
509 $this->setFilter($row->filter);
510 $this->enableSubdirCreation($row->create_subdir);
511 $this->setSubDirectoryType($row->subdir_type);
512 $this->setDirectory($row->directory);
513 }
514
515 $this->parseFilter();
516 }

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

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 @global type $ilDB.

Returns
boolean

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

447 {
448 global $ilDB;
449
450 $this->setRuleId($ilDB->nextId('ecs_cmap_rule'));
451 $query = 'INSERT INTO ecs_cmap_rule ' .
452 '(rid,sid,mid,attribute,ref_id,is_filter,filter,create_subdir,subdir_type,directory) ' .
453 'VALUES (' .
454 $ilDB->quote($this->getRuleId(), 'integer') . ', ' .
455 $ilDB->quote($this->getServerId(), 'integer') . ', ' .
456 $ilDB->quote($this->getMid(), 'integer') . ', ' .
457 $ilDB->quote($this->getAttribute(), 'text') . ', ' .
458 $ilDB->quote($this->getRefId(), 'integer') . ', ' .
459 $ilDB->quote($this->isFilterEnabled(), 'integer') . ', ' .
460 $ilDB->quote($this->getFilter(), 'text') . ', ' .
461 $ilDB->quote($this->isSubdirCreationEnabled(), 'integer') . ', ' .
462 $ilDB->quote($this->getSubDirectoryType(), 'integer') . ', ' .
463 $ilDB->quote($this->getDirectory(), 'text') . ' ' .
464 ')';
465 $ilDB->manipulate($query);
466 return $this->getRuleId();
467 }

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

+ Here is the call graph for this function:

◆ setAttribute()

ilECSCourseMappingRule::setAttribute (   $a_att)

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

357 {
358 $this->attribute = $a_att;
359 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDirectory()

ilECSCourseMappingRule::setDirectory (   $a_dir)

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

422 {
423 $this->directory = $a_dir;
424 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setFilter()

ilECSCourseMappingRule::setFilter (   $a_filter)

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

387 {
388 $this->filter = $a_filter;
389 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMid()

ilECSCourseMappingRule::setMid (   $a_mid)

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

347 {
348 $this->mid = $a_mid;
349 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRefId()

ilECSCourseMappingRule::setRefId (   $a_ref_id)

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

367 {
368 $this->ref_id = $a_ref_id;
369 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRuleId()

ilECSCourseMappingRule::setRuleId (   $a_rule_id)

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

327 {
328 $this->rid = $a_rule_id;
329 }

Referenced by save().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseMappingRule::setServerId (   $a_server_id)

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

337 {
338 $this->sid = $a_server_id;
339 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setSubDirectoryType()

ilECSCourseMappingRule::setSubDirectoryType (   $a_type)

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

412 {
413 $this->subdir_type = $a_type;
414 }
$a_type
Definition: workflow.php:92

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilECSCourseMappingRule::update ( )

Update mapping rule @global type $ilDB.

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

474 {
475 global $ilDB;
476
477 $query = 'UPDATE ecs_cmap_rule ' . ' ' .
478 'SET ' .
479 'attribute = ' . $ilDB->quote($this->getAttribute(), 'text') . ', ' .
480 'ref_id = ' . $ilDB->quote($this->getRefId(), 'integer') . ', ' .
481 'is_filter = ' . $ilDB->quote($this->isFilterEnabled(), 'integer') . ', ' .
482 'filter = ' . $ilDB->quote($this->getFilter(), 'text') . ', ' .
483 'create_subdir = ' . $ilDB->quote($this->isSubdirCreationEnabled(), 'integer') . ', ' .
484 'subdir_type = ' . $ilDB->quote($this->getSubDirectoryType(), 'integer') . ', ' .
485 'directory = ' . $ilDB->quote($this->getDirectory(), 'text') . ' ' .
486 'WHERE rid = ' . $ilDB->quote($this->getRuleId(), 'integer');
487 $ilDB->manipulate($query);
488 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $attribute

ilECSCourseMappingRule::$attribute
private

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

Referenced by getAttribute().

◆ $create_subdir

ilECSCourseMappingRule::$create_subdir = true
private

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

Referenced by isSubdirCreationEnabled().

◆ $directory

ilECSCourseMappingRule::$directory = ''
private

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

Referenced by getDirectory().

◆ $filter

ilECSCourseMappingRule::$filter
private

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

Referenced by getFilter(), and parseFilter().

◆ $filter_elements

ilECSCourseMappingRule::$filter_elements = []
private

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

Referenced by getFilterElements(), and parseFilter().

◆ $is_filter

ilECSCourseMappingRule::$is_filter = false
private

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

Referenced by isFilterEnabled().

◆ $logger

ilECSCourseMappingRule::$logger = null
private

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

◆ $mid

ilECSCourseMappingRule::$mid
private

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

Referenced by getMid().

◆ $ref_id

ilECSCourseMappingRule::$ref_id
private

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

Referenced by getRefId(), and getRuleRefIds().

◆ $rid

ilECSCourseMappingRule::$rid
private

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

Referenced by getRuleId().

◆ $sid

ilECSCourseMappingRule::$sid
private

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

Referenced by getServerId().

◆ $subdir_type

ilECSCourseMappingRule::$subdir_type = self::SUBDIR_VALUE
private

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

◆ SUBDIR_ATTRIBUTE_NAME

const ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME = 1

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

◆ SUBDIR_VALUE

const ilECSCourseMappingRule::SUBDIR_VALUE = 2

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

Referenced by getSubDirectoryType().


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