Tiny lints and indentations
This commit is contained in:
parent
1b096e5103
commit
87912f3153
|
@ -6,7 +6,6 @@ use \Tainacan\Entities;
|
|||
class Old_Tainacan extends Importer{
|
||||
|
||||
protected $steps = [
|
||||
|
||||
[
|
||||
'name' => 'Create Taxonomies',
|
||||
'progress_label' => 'Creating taxonomies',
|
||||
|
@ -33,7 +32,6 @@ class Old_Tainacan extends Importer{
|
|||
'callback' => 'link_relationships',
|
||||
'total' => 5
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
protected $tainacan_api_address, $wordpress_api_address, $actual_collection;
|
||||
|
@ -64,8 +62,7 @@ class Old_Tainacan extends Importer{
|
|||
*
|
||||
*/
|
||||
public function create_taxonomies() {
|
||||
|
||||
if(!$this->get_url()){
|
||||
if (!$this->get_url()) {
|
||||
$this->add_error_log('Site url not found');
|
||||
$this->abort();
|
||||
return false;
|
||||
|
@ -74,7 +71,6 @@ class Old_Tainacan extends Importer{
|
|||
$this->add_log('Creating taxonomies');
|
||||
|
||||
foreach ($this->get_taxonomies() as $taxonomy) {
|
||||
|
||||
$tax = new Entities\Taxonomy();
|
||||
$tax->set_name( $taxonomy->name );
|
||||
$tax->set_description( $taxonomy->description );
|
||||
|
@ -85,20 +81,16 @@ class Old_Tainacan extends Importer{
|
|||
$tax = $this->tax_repo->insert($tax);
|
||||
|
||||
$this->add_log('Taxonomy ' . $tax->get_name() . ' created, id from Old'. $taxonomy->term_id );
|
||||
|
||||
$this->add_transient('tax_' . $taxonomy->term_id . '_id', $tax->get_id());
|
||||
$this->add_transient('tax_' . $taxonomy->term_id . '_name', $tax->get_name());
|
||||
|
||||
if (isset($taxonomy->children) && $tax) {
|
||||
$this->add_all_terms($tax, $taxonomy->children);
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->add_log('Error creating taxonomy ' . $taxonomy->name );
|
||||
$this->add_log($tax->get_errors());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -108,18 +100,15 @@ class Old_Tainacan extends Importer{
|
|||
* create the repository metadata which each collection inherits by default
|
||||
*
|
||||
*/
|
||||
public function create_repo_metadata(){
|
||||
|
||||
public function create_repo_metadata() {
|
||||
$this->add_log('Creating repository metadata');
|
||||
|
||||
foreach ($this->get_repo_metadata() as $metadata) {
|
||||
|
||||
if (isset($metadata->slug) && strpos($metadata->slug, 'socialdb_property_fixed') === false) {
|
||||
$metadatum_id = $this->create_metadata( $metadata );
|
||||
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ){
|
||||
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ) {
|
||||
$metadatum_id = $this->create_metadata( $metadata );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->add_log('FInished repository metadata');
|
||||
|
|
Loading…
Reference in New Issue