Replace INBCM with TMDC or dwc

This commit is contained in:
Steve Dogiakos 2022-03-19 14:25:14 -06:00
parent a4d8bc0160
commit fc7dce7f97
8 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
{
"autoload": {
"psr-4": {
"INBCM\\Preset\\Tainacan\\": "src/"
"dwc\\Preset\\Tainacan\\": "src/"
}
}
}
}

View File

@ -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();

View File

@ -1,6 +1,6 @@
<?php
namespace INBCM\Preset\Tainacan\Classes\Controller;
namespace DWC\Preset\Tainacan\Classes\Controller;
class Preset {
@ -39,7 +39,7 @@ class Preset {
return false;
}
public function published_collection($collection, $data_preset)
public function published_collection($collection, $data_preset)
{
$data_collection = $data_preset['collection'];
$collection->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;
}
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace INBCM\Preset\Tainacan\Classes\Entities;
namespace DWC\Preset\Tainacan\Classes\Entities;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

View File

@ -1,6 +1,6 @@
<?php
namespace INBCM\Preset\Tainacan\Classes\Entities;
namespace DWC\Preset\Tainacan\Classes\Entities;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

View File

@ -1,5 +1,5 @@
<?php
//brasillian states, brasilion cities, get the city metadata file cidades.json and then estados.json
add_action( 'init', function() {
global $cidades_brasileiras, $estados_brasileiros;
$cidades = file_get_contents( plugin_dir_url(__FILE__) . 'metadata_type/cidades.json' );

View File

@ -21,8 +21,8 @@ class TainacanINBCMBootstrapt {
}
function registerExposerMapper($exposers) {
$exposers->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();