function GetGroupRequest(LOGGROUP $grp, MASK $mask = NULL) { if (!isset($this->list[$grp->gid])) { throw new ADEIException(translate("Unknown group (%s) is requested in SOURCETree::GetGroupRequest", $grp->gid)); } $info = $this->list[$grp->gid]; if ($mask && is_array($mask->ids)) { if ($info['items'] === false) { $info['props']['db_mask'] = $mask->GetProp(); } else { $ires = array(); foreach ($mask->ids as $id) { if (isset($info['items'][$id])) { array_push($ires, $info['items'][$id]); } else { throw new ADEIException(translate("Invalid mask, item (%s) is not present in group", $id)); } } if ($ires) { $info['props']['db_mask'] = implode(",", $ires); } else { $info['props']['db_mask'] = false; } } } /* if ($this->props_cast) { call_user_func($this->props_cast, $info['props'], $grp->gid); } */ return new GROUPRequest($info['props']); }
function Superpose(MASK $mask = NULL) { if (!$mask || $mask->IsFull()) { return $this; } else { if ($this->IsFull()) { return $mask; } } $res = array(); foreach ($mask->ids as $id) { if (isset($this->ids[$id])) { array_push($res, $this->ids[$id]); } else { throw new ADEIException(translate("Invalid mask (%s) is passed for supperposing. The base mask is (%s)", $mask->GetProp(), $this->GetProp())); } } $mask = new MASK(); $mask->SetIDs($res); return $mask; }
function CreateSimpleRequestSet(MASK $mask = NULL, LOGGROUP $grp = NULL, $type = "GROUPRequest") { $props = array(); if ($grp) { $props['db_group'] = $grp->GetProp(); } if ($mask) { $props['db_mask'] = $mask->GetProp(); } return new REQUESTList($this->props, $list = array($props), $type); }