From fc7dce7f97237afed54dd91b8c12a7264f8bc8b6 Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Sat, 19 Mar 2022 14:25:14 -0600 Subject: [PATCH] Replace INBCM with TMDC or dwc --- composer.json | 4 ++-- main.php | 2 +- src/Classes/Controller/Preset.php | 16 ++++++++-------- src/Classes/Entities/Collection.php | 2 +- src/Classes/Entities/Metadata.php | 2 +- .../Mapper/{MapperINBCM.php => MapperDWC.php} | 0 ...n-inbcm-preset.php => tainacan-dwc-preset.php | 2 +- tainacan-mapper-bootstrapt.php | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) rename src/Classes/Mapper/{MapperINBCM.php => MapperDWC.php} (100%) rename tainacan-inbcm-preset.php => tainacan-dwc-preset.php (79%) 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();