24 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
49 $res = $ilDB->query(
'SELECT mapping_id FROM ecs_container_mapping');
54 return $rules ? $rules : array();
68 if(is_null(self::$cached_active_rules))
72 foreach(self::$cached_active_rules as $rule)
74 if($rule->matches($econtent))
76 $ilLog->write(__METHOD__.
': Found assignment for field type: '.$rule->getFieldName());
77 return $rule->getContainerId();
79 $ilLog->write(__METHOD__.
': Category assignment failed for field: '.$rule->getFieldName());
82 $ilLog->write(__METHOD__.
': Using default container');
104 foreach($references as
$ref_id => $null)
106 if($tree->getParentId(
$ref_id) == $cat)
111 $ilLog->write(__METHOD__.
': Creating/Deleting references...');
112 include_once
'./classes/class.ilObjectFactory.php';
116 $ilLog->write(__METHOD__.
': Add new reference. STEP 1');
120 $new_ref_id = $obj_data->createReference();
121 $obj_data->putInTree($cat);
122 $obj_data->setPermissions($cat);
123 $ilLog->write(__METHOD__.
': Add new reference.');
127 foreach($references as
$ref_id => $null)
129 $parent = $tree->getParentId(
$ref_id);
134 if(!in_array($parent,$all_cats))
140 $to_delete->delete();
141 $ilLog->write(__METHOD__.
': Deleted deprecated reference.');
157 $res = $ilDB->query(
"SELECT container_id FROM ecs_container_mapping ");
160 $ref_ids[] =
$row->container_id;
162 return $ref_ids ? $ref_ids : array();