You are here

function ARC_simple_model::get_resources in Taxonomy import/export via XML 6.2

Same name and namespace in other branches
  1. 5.2 arc/ARC_simple_model.php \ARC_simple_model::get_resources()
  2. 5 arc/ARC_simple_model.php \ARC_simple_model::get_resources()
  3. 6 arc/ARC_simple_model.php \ARC_simple_model::get_resources()

File

arc/ARC_simple_model.php, line 142

Class

ARC_simple_model

Code

function get_resources($type = "") {
  if ($type) {
    if (is_array($type)) {
      $result = array();
      $added_resources = array();
      for ($i = 0, $i_max = count($type); $i < $i_max; $i++) {
        $cur_type = $type[$i];
        $cur_resources = $this->typed_resources[$this
          ->get_abbr_val($cur_type)];
        for ($j = 0, $j_max = count($cur_resources); $j < $j_max; $j++) {
          $cur_resource = $cur_resources[$j];
          $cur_resource_identifier = $cur_resource["val"];
          if (!$added_resources[$cur_resource_identifier]) {
            $result[] = $cur_resource;
            $added_resources[$cur_resource_identifier] = true;
          }
        }
      }
      return $result;
    }
    else {
      return $this->typed_resources[$this
        ->get_abbr_val($type)];
    }
  }
  else {
    return $this->resources;
  }
}