4include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
 
   24        $query = 
'SELECT ref_id FROM ecs_node_mapping_a ' .
 
   25            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
   26            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
   27            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
   44    public static function lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
 
   48        $query = 
'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a ' .
 
   49            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
   50            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
   51            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
   52            'AND cs_id = ' . 
$ilDB->quote($a_node_id, 
'integer');
 
   55        if (!
$res->numRows()) {
 
   61            $settings[
'title_update'] = 
$row->title_update;
 
   62            $settings[
'position_update'] = 
$row->position_update;
 
   63            $settings[
'tree_update'] = 
$row->tree_update;
 
   65        return (array) $settings;
 
   79        $query = 
'SELECT cs_id FROM ecs_node_mapping_a ' .
 
   80            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
   81            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
   82            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
   86        $assignments = array();
 
   88            $assignments[] = 
$row->cs_id;
 
  103        $query = 
'SELECT cs_id FROM ecs_node_mapping_a ' .
 
  104            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  105            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  106            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
  107            'AND ref_id = ' . 
$ilDB->quote($a_ref_id, 
'integer') . 
' ';
 
  110        $assignments = array();
 
  112            $assignments[] = 
$row->cs_id;
 
  127        $query = 
'SELECT depth FROM ecs_node_mapping_a ' .
 
  128            'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) ' .
 
  129            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  130            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  131            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ';
 
  134            return $row->depth == 1;
 
  146        $query = 
'SELECT title_update FROM ecs_node_mapping_a ' .
 
  147            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  148            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  149            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
  150            'AND cs_id = ' . 
$ilDB->quote(0, 
'integer') . 
' ';
 
  153            return (
bool) 
$row->title_update;
 
  171        $query = 
'SELECT cs_id FROM ecs_node_mapping_a ' .
 
  172            'WHERE server_id = ' . 
$ilDB->quote($a_server_id, 
'integer') . 
' ' .
 
  173            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  174            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
  175            'AND ref_id = ' . 
$ilDB->quote($a_ref_id, 
'integer') . 
' ';
 
  180            $cs_ids[] = 
$row->cs_id;
 
  199        $query = 
'DELETE FROM ecs_node_mapping_a ' .
 
  200            'WHERE server_id = ' . 
$ilDB->quote($a_server_id) . 
' ' .
 
  201            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  202            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ' .
 
  203            'AND ' . 
$ilDB->in(
'cs_id', $cs_ids, 
false, 
'integer');
 
  220        $query = 
'DELETE FROM ecs_node_mapping_a ' .
 
  221            'WHERE server_id = ' . 
$ilDB->quote($a_server_id) . 
' ' .
 
  222            'AND mid = ' . 
$ilDB->quote($a_mid, 
'integer') . 
' ' .
 
  223            'AND cs_root = ' . 
$ilDB->quote($a_tree_id, 
'integer') . 
' ';
 
  238        include_once 
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
 
  239        include_once 
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
 
  242        foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
 
  247                    $toDelete[] = $assignment;
 
  251                    $toDelete[] = $assignment;
 
  257                    $toDelete[] = $assignment;
 
  261                    $toDelete[] = $assignment;
 
An exception for terminatinating execution or to throw for unit testing.
const MAPPING_PENDING_DISCONNECTABLE
const MAPPING_PENDING_NOT_DISCONNECTABLE
static lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Lookup status.
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static hasAssignments($a_server_id, $a_mid, $a_tree_id)
Check if there is any assignment for a cms tree.
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id @global <type> $ilDB.
static isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)
Check if whole tree is mapped.
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings @global $ilDB.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings @global $ilDB $ilDB.
static lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
Lookup Settings.
static lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id)
Lookup assignments @global $ilDB.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
foreach($_POST as $key=> $value) $res