diff --git a/composer.json b/composer.json index 5d4e6b0..3292b94 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "autoload": { "psr-4": { - "INBCM\\Preset\\Tainacan\\": "src/" + "dwc\\Preset\\Tainacan\\": "src/" } } -} \ No newline at end of file +} diff --git a/main.php b/main.php index c33256e..b00b269 100644 --- a/main.php +++ b/main.php @@ -5,7 +5,7 @@ require_once __DIR__.'/app/config.php'; require_once __DIR__.'/vendor/autoload.php'; -use \INBCM\Preset\Tainacan\Classes\Controller; +use \dwc\Preset\Tainacan\Classes\Controller; echo "start main process!"; $preset = new Controller\Preset(); diff --git a/src/Classes/Controller/Preset.php b/src/Classes/Controller/Preset.php index 3d21119..a12cfd2 100644 --- a/src/Classes/Controller/Preset.php +++ b/src/Classes/Controller/Preset.php @@ -1,6 +1,6 @@ set_status($data_collection['status']); @@ -135,11 +135,11 @@ class Preset { $tax->set_description($taxonomy['description']); $tax->set_allow_insert($taxonomy['allow_insert']); $tax->set_status($taxonomy['status']); - + if ($tax->validate()) { $tax = $this->taxonomy_repository->insert($tax); $tax_db_identifier = $tax->get_db_identifier(); - + $position = 0; $last_term = 0; $parent = array(); @@ -154,7 +154,7 @@ class Preset { $position++; array_push($parent, $last_term); } - + while( $position > 0 && !($values[$position] != '' && $values[$position-1] == '' )) // back degree { $position--; @@ -173,7 +173,7 @@ class Preset { if(end($parent)) $term->set_parent(end($parent)); $term_exist = $this->term_repository->term_exists($term->get_name(), $tax, $term->get_parent(), true); - + if($term_exist === false) { if ($term->validate()) @@ -190,7 +190,7 @@ class Preset { { $last_term = $term_exist->term_id; } - + } } return $tax; @@ -198,4 +198,4 @@ class Preset { return false; } -} \ No newline at end of file +} diff --git a/src/Classes/Entities/Collection.php b/src/Classes/Entities/Collection.php index f613deb..cebb5ee 100644 --- a/src/Classes/Entities/Collection.php +++ b/src/Classes/Entities/Collection.php @@ -1,6 +1,6 @@ register_mapper('INBCM\Preset\Tainacan\Classes\Mapper\MapperDWC'); + $exposers->register_mapper('dwc\Preset\Tainacan\Classes\Mapper\MapperDWC'); } } -$tainacanMapperBootstrapt = new \INBCM\Preset\Tainacan\TainacanDWCBootstrapt(); +$tainacanMapperBootstrapt = new \dwc\Preset\Tainacan\TainacanDWCBootstrapt();