40 var $tree_propagation;
63 $this->hash = Array();
64 $this->tree_propagation = Array();
77 return empty($this->hash);
91 function _set($name, $value)
93 if (!isset($this->hash[$name])) {
94 $this->hash[$name] = Array();
97 if (!is_array($value)) $value = Array($value);
99 foreach ($value as $one_value) {
100 if (!in_array($one_value, $this->hash[$name])) {
101 $this->hash[$name][] = $one_value;
118 $this->
_set(
'event',$event);
133 $this->
_set(
'assetid',$assetid);
149 if (!empty($asset_type) && $GLOBALS[
'SQ_SYSTEM']->am->installed($asset_type)) {
154 $type_descendants = $GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants($asset_type, TRUE);
155 if (!empty($type_descendants)) {
156 $this->
_set(
'asset_type', $type_descendants);
160 $this->
_set(
'asset_type', $asset_type);
179 $this->
_set(
'treeid',$tree_id);
181 if (!is_array($tree_id)) $tree_id = Array($tree_id);
182 foreach ($tree_id as $id){
183 $this->tree_propagation[$id] = $propagation;
199 $this->
_set(
'triggerid',$trigger_id);
216 $this->
_set(
'parentid',$linked_id);
218 $this->
_set(
'childid',$linked_id);
236 $this->
_set(
'parent_type',$linked_type);
238 $this->
_set(
'child_type',$linked_type);
253 $result = $this->hash;
256 foreach ($result as $id => $data) {
257 if (empty($result[$id])) $result[$id] =
'-1';
273 foreach ($indicies as $index) {
274 if (!isset($result[$index])) $result[$index] =
'-1';
280 if ($result[
'treeid'] !=
'-1'){
281 foreach ($combinations as &$data){
282 $data[
'tree_propagate'] = $this->tree_propagation[$data[
'treeid']];
286 return $combinations;
323 foreach ($source as $source_key => $source_item) {
325 $new_result = Array();
327 if (!is_array($source_item)) {
328 $source_item = Array($source_item);
331 if (empty($result)) {
332 foreach ($source_item as $one_item) {
333 $new_result[] = Array($source_key => $one_item);
336 foreach ($result as $res) {
337 foreach ($source_item as $one_item) {
339 $new_res[$source_key] = $one_item;
340 $new_result[] = $new_res;
345 $result = $new_result;