ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 type $ilDB. More...
 
 update ()
 Update mapping rule 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 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 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.

References $GLOBALS, and read().

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

References $GLOBALS.

Referenced by doMapping().

268  {
269  // Create category
270  include_once './Modules/Category/classes/class.ilObjCategory.php';
271  $cat = new ilObjCategory();
272  $cat->setOwner(SYSTEM_USER_ID);
273  $cat->setTitle($a_title);
274  $cat->create();
275  $cat->createReference();
276  $cat->putInTree($a_parent_ref);
277  $cat->setPermissions($a_parent_ref);
278  $cat->deleteTranslation($GLOBALS['lng']->getDefaultLanguage());
279  $cat->addTranslation(
280  $a_title,
281  $cat->getLongDescription(),
282  $GLOBALS['lng']->getDefaultLanguage(),
283  1
284  );
285  return $cat->getRefId();
286  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Class ilObjCategory.
+ Here is the caller graph for this function:

◆ delete()

ilECSCourseMappingRule::delete ( )

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

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

455  {
456  global $ilDB;
457 
458  $query = 'DELETE from ecs_cmap_rule '.
459  'WHERE rid = '.$ilDB->quote($this->getRuleId(),'integer');
460  $ilDB->manipulate($query);
461  return true;
462  }
global $ilDB
+ 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 230 of file class.ilECSCourseMappingRule.php.

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

231  {
232  global $tree;
233 
234  if(!$this->isSubdirCreationEnabled())
235  {
236  return array();
237  }
238  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
240 
241  $childs = $tree->getChildsByType($parent_ref,'cat');
242  foreach($values as $value)
243  {
244  $found = false;
245  foreach((array) $childs as $child)
246  {
247  // category already created
248  if(strcmp($child['title'], $value) === 0)
249  {
250  $found = true;
251  $category_references[] = $child['child'];
252  break;
253  }
254  }
255  if(!$found)
256  {
257  $category_references[] = $this->createCategory($value, $parent_ref);
258  }
259  }
260  return (array) $category_references;
261  }
createCategory($a_title, $a_parent_ref)
Create attribute category.
static getCourseValueByMappingAttribute($course, $a_field)
Get course value by mapping.
Create styles array
The data for the language used.
+ 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 183 of file class.ilECSCourseMappingRule.php.

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

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

184  {
185  global $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  {
198  $rule = new ilECSCourseMappingRule($row->rid);
199  if($level == 1)
200  {
201  $last_level_category[] = $rule->getRefId();
202  }
203 
204  $found_new_level = false;
205  $new_level_cats = array();
206  foreach((array) $last_level_category as $cat_ref_id)
207  {
208  $refs = $rule->doMapping($course, $cat_ref_id);
209  foreach($refs as $new_ref_id)
210  {
211  $found_new_level = true;
212  $new_level_cats[] = $new_ref_id;
213  }
214  }
215  if($found_new_level)
216  {
217  $last_level_category = $new_level_cats;
218  }
219  $level++;
220  }
221 
222  return (array) $last_level_category;
223  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ enableFilter()

ilECSCourseMappingRule::enableFilter (   $a_status)

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

Referenced by read().

400  {
401  $this->is_filter = $a_status;
402  }
+ Here is the caller graph for this function:

◆ enableSubdirCreation()

ilECSCourseMappingRule::enableSubdirCreation (   $a_stat)

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

Referenced by read().

425  {
426  $this->create_subdir = $a_stat;
427  }
+ Here is the caller graph for this function:

◆ getAttribute()

ilECSCourseMappingRule::getAttribute ( )

Definition at line 384 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 449 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 414 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 419 of file class.ilECSCourseMappingRule.php.

References $filter_elements, and array.

Referenced by matches().

420  {
421  return (array) $this->filter_elements;
422  }
Create styles array
The data for the language used.
+ 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 type $ilDB.

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

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

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

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

332  {
333  global $ilDB;
334 
335  $query = 'SELECT rid FROM ecs_cmap_rule '.
336  'WHERE sid = '.$ilDB->quote($a_sid,'integer').' '.
337  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
338  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' '.
339  'AND attribute = '.$ilDB->quote($a_att,'text');
340 
341  $res = $ilDB->query($query);
342  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
343  {
344  return new ilECSCourseMappingRule($row->rid);
345  }
346  return new ilECSCourseMappingRule();
347  }
global $ilDB
+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseMappingRule::getMid ( )

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

References $mid.

Referenced by save().

375  {
376  return $this->mid;
377  }
+ Here is the caller graph for this function:

◆ getRefId()

ilECSCourseMappingRule::getRefId ( )

Definition at line 394 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 354 of file class.ilECSCourseMappingRule.php.

References $rid.

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

355  {
356  return $this->rid;
357  }
+ 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 72 of file class.ilECSCourseMappingRule.php.

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

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

73  {
74  global $ilDB;
75 
76  $query = 'SELECT DISTINCT(ref_id) ref_id, rid FROM ecs_cmap_rule '.
77  'WHERE sid = '.$ilDB->quote($a_sid,'integer').' '.
78  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
79  'GROUP BY ref_id'.' '.
80  'ORDER BY rid';
81 
82  $res = $ilDB->query($query);
83  $ref_ids = array();
84  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
85  {
86  $ref_ids[] = $row->ref_id;
87  }
88  // check if ref_ids are in tree
89  $checked_ref_ids = [];
90  foreach($ref_ids as $ref_id)
91  {
92  if(
93  $GLOBALS['DIC']->repositoryTree()->isInTree($ref_id))
94  {
95  $checked_ref_ids[] = $ref_id;
96  }
97  }
98  return $checked_ref_ids;
99  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
global $ilDB
+ 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 type $ilDB.

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

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

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

Referenced by ilECSMappingSettingsGUI\cDeleteRulesOfNode().

110  {
111  global $ilDB;
112 
113  $query = 'SELECT rid FROM ecs_cmap_rule '.
114  'WHERE sid = '.$ilDB->quote($a_sid,'integer').' '.
115  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
116  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer');
117  $res = $ilDB->query($query);
118  $rids = array();
119  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
120  {
121  $rids = $row->rid;
122  }
123  return (array) $rids;
124  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseMappingRule::getServerId ( )

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

References $sid.

Referenced by save().

365  {
366  return $this->sid;
367  }
+ Here is the caller graph for this function:

◆ getSubDirectoryType()

ilECSCourseMappingRule::getSubDirectoryType ( )

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

Referenced by save(), and update().

440  {
441  return self::SUBDIR_VALUE;
442  }
+ Here is the caller graph for this function:

◆ hasRules()

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

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

References $ilDB, $query, and $res.

Referenced by ilECSMappingSettingsGUI\cInitMappingForm().

127  {
128  global $ilDB;
129 
130  $query = 'SELECT ref_id FROM ecs_cmap_rule '.
131  'WHERE sid = '.$ilDB->quote($a_sid,'integer').' '.
132  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
133  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer');
134  $res = $ilDB->query($query);
135  return $res->numRows() ? true : false;
136  }
global $ilDB
+ Here is the caller graph for this function:

◆ isFilterEnabled()

ilECSCourseMappingRule::isFilterEnabled ( )

Definition at line 404 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 144 of file class.ilECSCourseMappingRule.php.

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

Referenced by ilECSCourseCreationHandler\doAttributeMapping().

145  {
146  global $ilDB;
147 
148  $query = 'SELECT rid FROM ecs_cmap_rule '.
149  'WHERE sid = '.$ilDB->quote($a_sid,'integer'). ' '.
150  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
151  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' '.
152  'ORDER BY rid';
153  $res = $ilDB->query($query);
154 
155  $does_match = false;
156  $sortable_index = '';
157  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
158  {
159  $rule = new ilECSCourseMappingRule($row->rid);
160  $matches = $rule->matches($course);
161  if($matches == -1)
162  {
163  return '0';
164  }
165  $does_match = true;
166  $sortable_index .= str_pad($matches, 4, '0' ,STR_PAD_LEFT);
167  }
168  if($does_match)
169  {
170  return $sortable_index;
171  }
172  return "0";
173  }
global $ilDB
+ Here is the caller graph for this function:

◆ isSubdirCreationEnabled()

ilECSCourseMappingRule::isSubdirCreationEnabled ( )

Definition at line 429 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.

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

Referenced by ilECSMappingSettingsGUI\cInitOverview().

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  {
62  $attributes = $row->attribute;
63  }
64  return $attributes;
65  }
Create styles array
The data for the language used.
global $ilDB
+ 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 294 of file class.ilECSCourseMappingRule.php.

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

295  {
296  if($this->isFilterEnabled())
297  {
298  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
300  $this->logger->dump($values);
301  $index = 0;
302  foreach($values as $value)
303  {
304  $index++;
305  foreach($this->getFilterElements() as $filter_element)
306  {
307  $this->logger->debug('Comparing ' . $value . ' with ' . $filter_element);
308  if(strcmp(trim($value), trim($filter_element)) === 0)
309  {
310  $this->logger->debug($value . ' matches ' . $filter_element);
311  $this->logger->debug('Found index: ' . $index);
312  return $index;
313  }
314  }
315  }
316  return -1;
317  }
318  return 0;
319  }
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 546 of file class.ilECSCourseMappingRule.php.

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

Referenced by read().

547  {
548  $filter = $this->getFilter();
549  //$this->logger->debug('Original filter: ' . $filter);
550 
551  $escaped_filter = str_replace('\,', '#:#', $filter);
552  //$this->logger->debug('Escaped filter: ' . $escaped_filter);
553 
554  $filter_elements = explode(',', $escaped_filter);
555  foreach((array) $filter_elements as $filter_element)
556  {
557  $replaced = str_replace('#:#', ',', $filter_element);
558  if(strlen(trim($replaced)))
559  {
560  $this->filter_elements[] = $replaced;
561  }
562  }
563  //$this->logger->dump($this->filter_elements);
564  }
Create styles array
The data for the language used.
+ 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 516 of file class.ilECSCourseMappingRule.php.

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

Referenced by __construct().

517  {
518  global $ilDB;
519 
520  if(!$this->getRuleId())
521  {
522  return true;
523  }
524  $query = 'SELECT * from ecs_cmap_rule '.' '.
525  'WHERE rid = '.$ilDB->quote($this->getRuleId(),'integer');
526  $res = $ilDB->query($query);
527  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
528  {
529  $this->setServerId($row->sid);
530  $this->setMid($row->mid);
531  $this->setRefId($row->ref_id);
532  $this->setAttribute($row->attribute);
533  $this->enableFilter($row->is_filter);
534  $this->setFilter($row->filter);
535  $this->enableSubdirCreation($row->create_subdir);
536  $this->setSubDirectoryType($row->subdir_type);
537  $this->setDirectory($row->directory);
538  }
539 
540  $this->parseFilter();
541  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSCourseMappingRule::save ( )

Save a new rule type $ilDB.

Returns
boolean

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

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

470  {
471  global $ilDB;
472 
473  $this->setRuleId($ilDB->nextId('ecs_cmap_rule'));
474  $query = 'INSERT INTO ecs_cmap_rule '.
475  '(rid,sid,mid,attribute,ref_id,is_filter,filter,create_subdir,subdir_type,directory) '.
476  'VALUES ('.
477  $ilDB->quote($this->getRuleId(),'integer').', '.
478  $ilDB->quote($this->getServerId(),'integer').', '.
479  $ilDB->quote($this->getMid(),'integer').', '.
480  $ilDB->quote($this->getAttribute(),'text').', '.
481  $ilDB->quote($this->getRefId(),'integer').', '.
482  $ilDB->quote($this->isFilterEnabled(),'integer').', '.
483  $ilDB->quote($this->getFilter(),'text').', '.
484  $ilDB->quote($this->isSubdirCreationEnabled(),'integer').', '.
485  $ilDB->quote($this->getSubDirectoryType(),'integer').', '.
486  $ilDB->quote($this->getDirectory(),'text').' '.
487  ')';
488  $ilDB->manipulate($query);
489  return $this->getRuleId();
490  }
global $ilDB
+ Here is the call graph for this function:

◆ setAttribute()

ilECSCourseMappingRule::setAttribute (   $a_att)

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

Referenced by read().

380  {
381  $this->attribute = $a_att;
382  }
+ Here is the caller graph for this function:

◆ setDirectory()

ilECSCourseMappingRule::setDirectory (   $a_dir)

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

Referenced by read().

445  {
446  $this->directory = $a_dir;
447  }
+ Here is the caller graph for this function:

◆ setFilter()

ilECSCourseMappingRule::setFilter (   $a_filter)

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

Referenced by read().

410  {
411  $this->filter = $a_filter;
412  }
+ Here is the caller graph for this function:

◆ setMid()

ilECSCourseMappingRule::setMid (   $a_mid)

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

Referenced by read().

370  {
371  $this->mid = $a_mid;
372  }
+ Here is the caller graph for this function:

◆ setRefId()

ilECSCourseMappingRule::setRefId (   $a_ref_id)

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

Referenced by read().

390  {
391  $this->ref_id = $a_ref_id;
392  }
+ Here is the caller graph for this function:

◆ setRuleId()

ilECSCourseMappingRule::setRuleId (   $a_rule_id)

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

Referenced by save().

350  {
351  $this->rid = $a_rule_id;
352  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseMappingRule::setServerId (   $a_server_id)

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

Referenced by read().

360  {
361  $this->sid = $a_server_id;
362  }
+ Here is the caller graph for this function:

◆ setSubDirectoryType()

ilECSCourseMappingRule::setSubDirectoryType (   $a_type)

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

References $a_type.

Referenced by read().

435  {
436  $this->subdir_type = $a_type;
437  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ update()

ilECSCourseMappingRule::update ( )

Update mapping rule type $ilDB.

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

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

497  {
498  global $ilDB;
499 
500  $query = 'UPDATE ecs_cmap_rule '.' '.
501  'SET '.
502  'attribute = '.$ilDB->quote($this->getAttribute(),'text').', '.
503  'ref_id = '.$ilDB->quote($this->getRefId(),'integer').', '.
504  'is_filter = '.$ilDB->quote($this->isFilterEnabled(),'integer').', '.
505  'filter = '.$ilDB->quote($this->getFilter(),'text').', '.
506  'create_subdir = '.$ilDB->quote($this->isSubdirCreationEnabled(),'integer').', '.
507  'subdir_type = '.$ilDB->quote($this->getSubDirectoryType(),'integer').', '.
508  'directory = '.$ilDB->quote($this->getDirectory(),'text').' '.
509  'WHERE rid = '.$ilDB->quote($this->getRuleId(),'integer');
510  $ilDB->manipulate($query);
511  }
global $ilDB
+ 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.


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