예제 #1
0
 public function getDestinationType()
 {
     $vo_dm = Datamodel::load();
     $vs_destination = $this->get("destination");
     $t_importer = new ca_data_importers($this->get("importer_id"));
     $t_instance = $vo_dm->getInstanceByTableNum($t_importer->get("table_num"));
     $va_split = explode(".", $vs_destination);
     switch (sizeof($va_split)) {
         case 1:
             return __CA_DATA_IMPORTER_DESTINATION_RELATED__;
         case 2:
             if (trim($va_split[0]) == $t_instance->tableName()) {
                 if ($t_instance->hasField(trim($va_split[1]))) {
                     return __CA_DATA_IMPORTER_DESTINATION_INTRINSIC__;
                 } else {
                     if ($t_instance->isValidMetadataElement(trim($va_split[1]))) {
                         return __CA_DATA_IMPORTER_DESTINATION_ATTRIBUTE__;
                     } else {
                         return __CA_DATA_IMPORTER_DESTINATION_META__;
                     }
                 }
             } else {
                 return __CA_DATA_IMPORTER_DESTINATION_RELATED__;
             }
         case 3:
         default:
             return __CA_DATA_IMPORTER_DESTINATION_META__;
     }
 }