Ejemplo n.º 1
0
 /**
  * Test a copy of an array
  */
 public function testArrayCopy()
 {
     $class = new stdClass();
     $class->name = 'Empty class';
     $array = ['foo' => 'bar', 'faa' => $class, 'fii' => ['beer' => 'zoo']];
     $this->assertNotSame(array_copy($array), $array);
 }
Ejemplo n.º 2
0
/**
 * make a recursive copy of an array 
 *
 * @param array $aSource
 * @return array    copy of source array
 */
function array_copy($aSource)
{
    // check if input is really an array
    if (!is_array($aSource)) {
        throw new Exception("Input is not an Array");
    }
    // initialize return array
    $aRetAr = array();
    // get array keys
    $aKeys = array_keys($aSource);
    // get array values
    $aVals = array_values($aSource);
    // loop through array and assign keys+values to new return array
    for ($x = 0; $x < count($aKeys); $x++) {
        // clone if object
        if (is_object($aVals[$x])) {
            $aRetAr[$aKeys[$x]] = clone $aVals[$x];
            // recursively add array
        } elseif (is_array($aVals[$x])) {
            $aRetAr[$aKeys[$x]] = array_copy($aVals[$x]);
            // assign just a plain scalar value
        } else {
            $aRetAr[$aKeys[$x]] = $aVals[$x];
        }
    }
    return $aRetAr;
}
Ejemplo n.º 3
0
Archivo: CSS.php Proyecto: h3rb/page
 public function Duplicate()
 {
     $css = new CSS();
     $css->tag = array_copy($this->tag);
     $css->classes = array_copy($this->classes);
     $css->styling = array_copy($this->styling);
     return $css;
 }
Ejemplo n.º 4
0
 public function Duplicate($x, $y)
 {
     $cell = new GridCell($x, $y);
     $cell->tag = array_copy($this->tag);
     $cell->value = $this->value;
     $cell->fg = $this->fg->Duplicate();
     $cell->bg = $this->bg->Duplicate();
     $cell->css = $this->css->Duplicate();
     $cell->mergeRight = $this->mergeRight;
     return $cell;
 }
Ejemplo n.º 5
0
 /**
  * Copy an array recursively and all his values (clone objects)
  * 
  * @param array $array Array to copy
  *
  * @return array Copy of initial array
  */
 function array_copy(array $array)
 {
     $copy = array();
     foreach ($array as $key => $val) {
         if (is_array($val)) {
             $copy[$key] = array_copy($val);
         } elseif (is_object($val)) {
             $copy[$key] = clone $val;
         } else {
             $copy[$key] = $val;
         }
     }
     return $copy;
 }
Ejemplo n.º 6
0
 public static function saveBlog($sName, &$blog)
 {
     if (empty($blog['@attributes'])) {
         $blog['@attributes'] = array();
     }
     if (empty($blog['@attributes']['section'])) {
         $blog['@attributes']['section'] = $sName;
     }
     $blogCopy = array_copy($blog);
     Array_XML::addCDATA($blogCopy);
     if ($xml = Array_XML::array2xml($blogCopy, 'blog')) {
         $fileName = self::$options['XML_ROOT'] . str_replace('%', $sName, self::$options['blog.%.xml']);
         file_put_contents($fileName, $xml);
         @chmod($fileName, 0666);
         return true;
     }
 }
Ejemplo n.º 7
0
 /**
  * sendModeLine
  * This method is responsible for accepting a mode change string performed
  * against either a user or channel and sending it to the server as either
  * one or several different mode change strings if it exceeds the maximum
  * number of mode changes per line. This rule does not apply to user mode
  * changes, only channel mode changes.
  * 
  * For instance, the following changes would be sent:
  *      In:   AEBIm M brian :+owg
  *      Out:  AEBIm M brian :+owg
  * 
  *      In:   AEBIm M #dev +ntooovvv AEBf6 AEBf7 AEBf8 AEBf9 AEBfa Cm6Dq 112603551
  *      Out:  AEBIm M #dev +ntooov AEBf6 AEBf7 AEBf8 AEBf9 112603551
  *            AEBIm M #dev +vv AEBfa CM6Dq
  * 
  *            Note that two lines are actually sent here, since ircu limits
  *            mode changes to six per line.
  */
 function sendModeLine($proto_str)
 {
     $args = explode(' ', $proto_str);
     $source = $args[0];
     $target = $args[2];
     $outgoing = array();
     $param_modes = array('l', 'k', 'A', 'U', 'b', 'v', 'o');
     $mode_count = 0;
     $is_chan = $target[0] == '#';
     if ($is_chan) {
         $chan = $this->getChannel($target);
         $modes = $args[3];
         $arg_num = 4;
         $tmp_modes = '';
         $tmp_pol = '';
         $tmp_args = array();
         $rem_args = array_copy($args, $arg_num);
         for ($i = 0; $i < strlen($modes); $i++) {
             $mode = $modes[$i];
             $tmp_modes .= $mode;
             if ($mode == '+' || $mode == '-') {
                 $tmp_pol = $mode;
                 continue;
             }
             if (in_array($mode, $param_modes)) {
                 $tmp_args[] = $args[$arg_num++];
                 array_shift($rem_args);
             }
             if (++$mode_count == MAX_MODES_PER_LINE || $i == strlen($modes) - 1) {
                 $outgoing[] = irc_sprintf("%s M %s %s%s%A", $source, $target, $tmp_modes, count($tmp_args) > 0 ? ' ' : '', $tmp_args);
                 $mode_count = 0;
                 $tmp_modes = $tmp_pol;
                 $tmp_args = array();
             }
         }
         foreach ($outgoing as $tmp_line) {
             /**
              * If our remaining arguments array has one numeric value left over
              * that did not correspond to a mode, then it is probably a mode
              * hack timestamp. Append it to the previously generated line.
              */
             if (count($rem_args) == 1 && is_numeric($rem_args[0])) {
                 $chan_ts = $rem_args[0];
             } else {
                 $chan_ts = $chan->getTs();
             }
             $tmp_line .= ' ' . $chan_ts;
             $this->sendf($tmp_line);
             $this->parseMode($tmp_line);
         }
     } else {
         $outgoing[] = $proto_str;
         // TODO: This portion isn't actually used anywhere yet... but isn't there something missing here?
     }
 }
Ejemplo n.º 8
0
 public function array_copy($arr)
 {
     $newArray = array();
     foreach ($arr as $key => $value) {
         if (is_array($value)) {
             $newArray[$key] = array_copy($value);
         } else {
             if (is_object($value)) {
                 $newArray[$key] = clone $value;
             } else {
                 $newArray[$key] = $value;
             }
         }
     }
     return $newArray;
 }
Ejemplo n.º 9
0
 function matches($a, $b, $case = FALSE)
 {
     if (is_array($a) && is_array($b)) {
         // array recurse
         if (count($a) !== count($b)) {
             return FALSE;
         }
         $_A = array_copy($a);
         $_B = array_copy($b);
         while (count($_A) > 0) {
             $one = array_pop($_A);
             $two = array_pop($_B);
             if (matches($one, $two, $case) === FALSE) {
                 return FALSE;
             }
         }
         return TRUE;
     } else {
         if (is_string($a) && is_string($b)) {
             // case insensitive match
             $a = trim($a);
             $b = trim($b);
             if ($case === FALSE) {
                 return strcasecmp($a, $b) === 0 ? TRUE : FALSE;
             } else {
                 return strcmp($a, $b) === 0 ? TRUE : FALSE;
             }
         } else {
             if (is_integer($a) && is_integer($b)) {
                 return $a === $b ? TRUE : FALSE;
             } else {
                 if (is_double($a) && is_double($b)) {
                     return $a === $b ? TRUE : FALSE;
                 } else {
                     if ((is_integer($a) || is_double($a)) && (is_integer($b) || is_double($b))) {
                         return floatval($a) == floatval($b) ? TRUE : FALSE;
                     } else {
                         if (is_bool($a) && is_bool($b)) {
                             return $a === $b ? TRUE : FALSE;
                         } else {
                             if (is_object($a) && is_object($b)) {
                                 if ($a->is($b) === FALSE) {
                                     return FALSE;
                                 }
                                 return $a == $b ? TRUE : FALSE;
                             } else {
                                 return $a == $b ? TRUE : FALSE;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 10
0
    //             $quotation_attraction_tickets = 0;
    //         }else{
    //             $quotation_attraction_tickets = 1;
    //         }
    //         if($_POST['quotation_meals']!='on'){
    //             $quotation_meals = 0;
    //         }else{
    //             $quotation_meals = 1;
    //         }
    //         if($_POST['quotation_transfers']!='on'){
    //             $quotation_transfers = 0;
    //         }else{
    //             $quotation_transfers = 1;
    //         }
    $update_data = array();
    $update_data = array_copy('id,country_residence,destination,source,handled_by,agent_name,client_name,email,in_date,tr_date,arrival_date,arrival_option,number_of_night,adults,child,infant,currency,budget_from,budget_to,remarks,hotel_start_preference,status' . $dated, $_POST);
    InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'inquiry', 'id');
    $message = "Inquiry has beed updated";
    enqueueMsg($message, "success", "inquiry.php");
}
if (isset($_GET['id'])) {
    $id = $_GET["id"];
    $where = array('id' => $id);
    $result_arr = getRows(DB_TABLE_PREFIX . 'inquiry', $where);
    if ($result_arr['total_recs'] > 0) {
        $result = $result_arr['result'];
        $row_data = GetArr($result);
        extract($row_data);
        $var_clear = false;
    } else {
        enqueueMsg('Invalid record id.', "alert");
Ejemplo n.º 11
0
        $_POST['last_updated'] = date("Y-m-d H:i:s");
    }
    if (isset($_POST['is_active'])) {
        $_POST['is_active'] = 'Y';
    } else {
        $_POST['is_active'] = 'N';
    }
    if (empty($slug)) {
        $msg = displayMsg('Enter slug.', 'error');
        $var_clear = false;
    } else {
        $slugResult = getRows(DB_TABLE_PREFIX . 'category', 'WHERE ' . implode(' AND ', $slugWhere));
        $message_type = 'success';
        if ($slugResult['total_recs'] == 0) {
            $update_data = array();
            $update_data = array_copy('id,title,slug,description,sort_order,is_active' . $dated, $_POST);
            $new_id = InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'category', 'id');
            $message = "Record has beed " . ($id > 0 ? 'updated' : 'added') . ".";
            enqueueMsg($message, $message_type);
        } else {
            $msg = displayMsg('This slug "' . $slug . '" already is use.', 'error');
            $var_clear = false;
        }
    }
}
if (isset($_GET['id'])) {
    $id = $_GET["id"];
    $where = array('id' => $id);
    $result_arr = getRows(DB_TABLE_PREFIX . 'category', $where);
    if ($result_arr['total_recs'] > 0) {
        $result = $result_arr['result'];
Ejemplo n.º 12
0
function array_copy($source)
{
    $retval = array();
    foreach ($source as $key => $value) {
        if (is_array($value)) {
            $retval[$key] = array_copy($value);
        } else {
            $retval[$key] = $value;
        }
    }
    return $retval;
}
Ejemplo n.º 13
0
 public function markiere_termin_indizes()
 {
     for ($e = 0; $e < count($this->termine); $e++) {
         $aktueller_termin = $this->termine[$e];
         $spalte_gefunden = false;
         for ($spalte = 0; $spalte < $aktueller_termin->hole_spalten_gesamt() && !$spalte_gefunden; $spalte++) {
             $nachbarn = array_copy($this->termine);
             unset($nachbarn[$e]);
             $termine = $this->filtere_termine($nachbarn, $aktueller_termin->hole_start(), $aktueller_termin->hole_ende(), $spalte);
             if (count($termine) == 0) {
                 $spalte_gefunden = true;
                 $aktueller_termin->setze_spalte($spalte);
             }
         }
     }
     for ($e = 0; $e < count($this->termine); $e++) {
         if ($this->termine[$e]->hole_spalte() === -1) {
             $this->termine[$e]->setze_spalte($this->termine[$e]->hole_spalten_gesamt() - 1);
         }
     }
 }
Ejemplo n.º 14
0
        $_POST['welcome'] = '1';
    } else {
        $_POST['welcome'] = '0';
    }
    if ($_POST['dinner'] == 'on') {
        $_POST['dinner'] = '1';
    } else {
        $_POST['dinner'] = '0';
    }
    if ($_POST['bike'] == 'on') {
        $_POST['bike'] = '1';
    } else {
        $_POST['bike'] = '0';
    }
    $update_data = array();
    $update_data = array_copy('id,full_name,email,mobile,hotel_name,hotel_address,room_no,total_adult,total_child,tour_date,per_adult_price,per_child_price,total_adult_price,total_child_price,total_price,payment_mod,status,last_updated,guide,pickup,insurance,coffee,coffee,welcome,dinner,bike,delivery_type,delivery_time' . $dated, $_POST);
    InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'order', 'id');
    $message = "Order has beed updated";
    enqueueMsg($message, "success", "order.php");
}
if (isset($_GET['id'])) {
    $id = $_GET["id"];
    $where = array('id' => $id);
    $result_arr = getRows(DB_TABLE_PREFIX . 'order', $where);
    if ($result_arr['total_recs'] > 0) {
        $result = $result_arr['result'];
        $row_data = GetArr($result);
        extract($row_data);
        $var_clear = false;
    } else {
        enqueueMsg('Invalid record id.', "alert");
Ejemplo n.º 15
0
 } else {
     $dated = ',last_updated';
     $_POST['last_updated'] = date("Y-m-d H:i:s");
 }
 if (isset($_POST['is_active'])) {
     $_POST['is_active'] = 'Y';
 } else {
     $_POST['is_active'] = 'N';
 }
 if (isset($_POST['is_feature'])) {
     $_POST['is_feature'] = 'Y';
 } else {
     $_POST['is_feature'] = 'N';
 }
 $update_data = array();
 $update_data = array_copy('id,category_id,code,title,short_description,long_description,adult_price,child_price,sort_order,is_active,is_feature' . $dated, $_POST);
 $product_id = InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'product', 'id');
 $allowedExts = array("gif", "jpeg", "jpg", "png");
 if (!empty($_FILES["image"]["name"])) {
     $path_parts = pathinfo($_FILES["image"]["name"]);
     $extension = $path_parts['extension'];
     if (($_FILES["image"]["type"] == "image/gif" || $_FILES["image"]["type"] == "image/jpeg" || $_FILES["image"]["type"] == "image/jpg" || $_FILES["image"]["type"] == "image/pjpeg" || $_FILES["image"]["type"] == "image/x-png" || $_FILES["image"]["type"] == "image/png") && in_array($extension, $allowedExts)) {
         $fileName = "product_" . $product_id . '.' . $extension;
         move_uploaded_file($_FILES["image"]["tmp_name"], "../images/products/" . $fileName);
         $update_image = array('image' => $fileName, 'id' => $product_id);
         InsertUpdateRecord($update_image, DB_TABLE_PREFIX . 'product', 'id');
     } else {
         enqueueMsg("Image type does not uploaded, Invalid image file.", "error", 'product.php', false);
     }
 }
 $message = "Record has been " . ($id > 0 ? 'updated' : 'added') . ".";
Ejemplo n.º 16
0
require_once '../inc/admin_secure.inc.php';
$msg = deQueueMsg();
$var_clear = true;
if (!empty($_POST)) {
    extract($_POST);
    if (isset($_POST['is_active'])) {
        $_POST['is_active'] = 'Y';
    } else {
        $_POST['is_active'] = 'N';
    }
    if (empty($services)) {
        $msg = displayMsg('Enter Service name.', 'error');
        $var_clear = false;
    } else {
        $update_data = array();
        $update_data = array_copy('id,services,price,sort_order,is_active');
        $new_id = InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'services', 'id');
        $message = "Record has beed " . ($id > 0 ? 'updated' : 'added') . ".";
        enqueueMsg($message, $message_type);
    }
}
if (isset($_GET['id'])) {
    $id = $_GET["id"];
    $where = array('id' => $id);
    $result_arr = getRows(DB_TABLE_PREFIX . 'services', $where);
    if ($result_arr['total_recs'] > 0) {
        $result = $result_arr['result'];
        $row_data = GetArr($result);
        extract($row_data);
        $var_clear = false;
    } else {
Ejemplo n.º 17
0
 } else {
     $_POST['free_and_easy'] = '0';
 }
 $hours = $_POST['hours'];
 $_POST['time'] = implode(',', $timelist);
 //==================Other services=======//
 $_POST['other_services'] = implode(',', $_POST['other_services']);
 if (empty($slug)) {
     $msg = displayMsg('Enter slug.', 'error');
     $var_clear = false;
 } else {
     $slugResult = getRows(DB_TABLE_PREFIX . 'product', 'WHERE ' . implode(' AND ', $slugWhere));
     $message_type = 'success';
     if ($slugResult['total_recs'] == 0) {
         $update_data = array();
         $update_data = array_copy('id,category_id,code,title,slug,short_description,long_description,adult_price,child_price,sort_order,is_active,is_feature,transpot_type,transpot_no,parking,address,Language,museum,accessibiliy,pet_allowed,audio_guide,tour_guide,attraction,wildlife,park,garden,adventure,free_entry,nature,scenic,culture,food,relaxing,activity,one_way_transfer,two_way_transfer,free_and_easy,hours,promo_adult_price,promo_child_price,feature,time,other_services,date_mandatory,delivery_option' . $dated, $_POST);
         $product_id = InsertUpdateRecord($update_data, DB_TABLE_PREFIX . 'product', 'id');
         if ($id == 0) {
             $p_id = mysql_insert_id();
         } else {
             $p_id = $id;
         }
         if ($id != 0) {
             //$query2="UPDATE schedule_m1 SET month='".$month."',monday='".$monday."',tuesday='".$tuesday."',wednesday='".$wednesday."',thursday='".$thursday."',friday='".$friday."',saturday='".$saturday."',sunday='".$sunday."' where id='".$M1_id."'";
             $_POST['id'] = $M1_id;
             $update_schdule_M1 = array('id' => $_POST['id'], 'product_id' => $p_id, 'month' => $month, 'monday' => $monday, 'tuesday' => $tuesday, 'wednesday' => $wednesday, 'thursday' => $thursday, 'friday' => $friday, 'saturday' => $saturday, 'sunday' => $sunday);
             InsertUpdateRecord($update_schdule_M1, DB_TABLE_PREFIX . 'schedule_m1', 'id');
         } else {
             if ($month != "") {
                 $update_schdule_M1 = array('month' => $month, 'monday' => $monday, 'tuesday' => $tuesday, 'wednesday' => $wednesday, 'thursday' => $thursday, 'friday' => $friday, 'saturday' => $saturday, 'sunday' => $sunday, 'product_id' => $p_id);
                 InsertUpdateRecord($update_schdule_M1, DB_TABLE_PREFIX . 'schedule_m1', 'id');
Ejemplo n.º 18
0
 protected static function reduceVertex(&$template, $numVertex, $connected, $directed)
 {
     $tempTemplate = array_copy($template);
     $indexList = array_keys($template["internalAdjList"]);
     $loopLimit = 10 * (count($indexList) - $numVertex);
     if ($loopLimit < 0) {
         $loopLimit = 0;
     }
     $loopBreaker = 0;
     while (count($indexList) > 0 && $loopBreaker < $loopLimit) {
         if (count($tempTemplate["internalAdjList"]) <= $numVertex) {
             break;
         }
         $indexChosen = rand(0, count($indexList) - 1);
         $index = $indexList[$indexChosen];
         $templateCopy = array_copy($tempTemplate);
         $adjacent = $tempTemplate["internalAdjList"][$index];
         unset($adjacent["cxPercentage"]);
         unset($adjacent["cyPercentage"]);
         foreach ($adjacent as $key => $value) {
             if ($directed) {
                 unset($templateCopy["internalEdgeList"][$templateCopy["internalAdjList"][$key][$index]]);
             }
             unset($templateCopy["internalAdjList"][$key][$index]);
             unset($templateCopy["internalEdgeList"][$value]);
         }
         if ($directed) {
             foreach ($templateCopy["internalAdjList"] as $key => $value) {
                 if (isset($value[$index])) {
                     unset($templateCopy["internalEdgeList"][$value[$index]]);
                     unset($templateCopy["internalAdjList"][$key][$index]);
                 }
             }
         }
         unset($templateCopy["internalAdjList"][$index]);
         if (!$connected || self::isConnected($templateCopy, $directed)) {
             $tempTemplate = $templateCopy;
         }
         unset($indexList[$indexChosen]);
         $indexList = array_values($indexList);
         $loopBreaker++;
     }
     // echo "<br/><br/>";
     //   echo json_encode($template);
     //   echo "<br/>";
     //   echo json_encode($tempTemplate);
     // echo "<br/><br/>";
     // echo "aaa";
     // echo "<br/><br/>";
     $template = $tempTemplate;
 }
Ejemplo n.º 19
0
 public function renderModule($templateName, $parameters = null)
 {
     $ttt = ModuleHelpers::findModuleClass($templateName);
     $className = $ttt[0];
     $classPath = $ttt[1];
     require_once $classPath;
     $moduleClass = new $className();
     $moduleClass->setModuleChain($this->_moduleChain);
     $runData = $this->runData;
     $runData->setModuleTemplate($templateName);
     if (!$moduleClass->isAllowed($runData)) {
         throw new WDPermissionException("Not allowed.");
     }
     $pl = $runData->getParameterList();
     $plOrig = clone $pl;
     $contextOrig = $runData->getContext();
     $runData->contextDel();
     // add new parameters ...
     $origParms = clone $runData->getParameterList();
     if ($parameters !== null && $parameters !== "") {
         // first parse the parameters string
         $parameters = urldecode($parameters);
         $re = '/([a-zA-Z][a-zA-Z0-9\\-_]*)="([^"]*)"/';
         preg_match_all($re, $parameters, $pout, PREG_SET_ORDER);
         for ($i = 0; $i < count($pout); $i++) {
             if ($pout[$i][1] == "module_body") {
                 $pout[$i][2] = urldecode($pout[$i][2]);
             }
             $pl->addParameter($pout[$i][1], $pout[$i][2], "MODULE");
         }
     }
     // the RunData object MUST be cloned at this point - to avoid context mixing between
     // the module and the global (screen) context.
     try {
         $out = $moduleClass->render($runData);
     } catch (Exception $e) {
         // restore old parameters ...
         $runData->setContext($contextOrig);
         $runData->setParameterList($plOrig);
         // recurent (for nested modules to work):
         $out = $this->process($out);
         $this->level--;
         throw $e;
     }
     // check if there are any javascript files for this module
     $js2include = array();
     $file = WIKIDOT_ROOT . '/' . GlobalProperties::$MODULES_JS_PATH . '/' . $templateName . '.js';
     if (file_exists($file)) {
         $url = GlobalProperties::$MODULES_JS_URL . '/' . $templateName . '.js';
         $js2include[] = $url;
     }
     $js2include = array_merge($js2include, $moduleClass->getExtraJs());
     foreach ($js2include as $jsUri) {
         if ($this->javascriptInline) {
             // and include them via <script> tags now
             $incl = '<script type="text/javascript" src="' . $jsUri . '"></script>';
             $out .= $incl;
         } else {
             // include later
             $jsInclude = $runData->getTemp("jsInclude");
             $jsInclude[] = $jsUri;
             $runData->setTemp("jsInclude", $jsInclude);
         }
     }
     // check if any css file exists
     $file = WIKIDOT_ROOT . '/' . GlobalProperties::$MODULES_CSS_PATH . '/' . $templateName . '.css';
     if (file_exists($file)) {
         $url = GlobalProperties::$MODULES_CSS_URL . '/' . $templateName . '.css';
         $this->cssInclude[] = $url;
     }
     // restore old parameters ...
     $runData->setContext($contextOrig);
     $runData->setParameterList($plOrig);
     $moduleChainOrig = array_copy($this->_moduleChain);
     $this->_moduleChain[] = $moduleClass;
     // recurent (for nested modules to work):
     $out = $this->process($out);
     $this->level = $this->level - 1;
     $this->_moduleChain = $moduleChainOrig;
     // check if the module wants to modify the page itself
     if ($moduleClass->getProcessPage()) {
         $this->modulesToProcessPage[] = $moduleClass;
     }
     return $out;
 }
Ejemplo n.º 20
0
 function removeChannel($name)
 {
     $channels = $this->channels;
     for ($i = 0; $i < count($channels); ++$i) {
         if ($channels[$i] == $name) {
             unset($channels[$i]);
             break;
         }
     }
     $this->channels = array_copy($channels);
 }