ARC2::getMergedIndex PHP Method

getMergedIndex() static public method

static public getMergedIndex ( )
    static function getMergedIndex()
    {
        $r = array();
        foreach (func_get_args() as $index) {
            foreach ($index as $s => $ps) {
                if (!isset($r[$s])) {
                    $r[$s] = array();
                }
                foreach ($ps as $p => $os) {
                    if (!isset($r[$s][$p])) {
                        $r[$s][$p] = array();
                    }
                    foreach ($os as $o) {
                        if (!in_array($o, $r[$s][$p])) {
                            $r[$s][$p][] = $o;
                        }
                    }
                }
            }
        }
        return $r;
    }

Usage Example

 /**
  * toIndex
  * @return array
  */
 public function toIndex()
 {
     $index = array();
     foreach ($this->resources as $res) {
         $index = ARC2::getMergedIndex($index, $res->index);
     }
     return $index;
 }
All Usage Examples Of ARC2::getMergedIndex