public static function reindex_concept($args) { $taxon_concept_id = $args['taxon_concept_id']; if (!$taxon_concept_id || !is_numeric($taxon_concept_id)) { throw new \Exception("The TaxonConceptID was missing or was not a number"); return; } Tasks::update_taxon_concept_names(array($taxon_concept_id)); $he = new FlattenHierarchies(); $he->flatten_hierarchies_from_concept_id($taxon_concept_id); TaxonConcept::reindex_descendants_objects($taxon_concept_id); TaxonConcept::reindex_for_search($taxon_concept_id); TaxonConcept::unlock_classifications_by_id($taxon_concept_id); }
public static function update_concept($taxon_concept_id) { if (!$taxon_concept_id || !is_numeric($taxon_concept_id)) { echo "\n\n\t#update_concept([taxon_concept_id])\n\n"; return false; } $taxon_concept = TaxonConcept::find($taxon_concept_id); Tasks::update_taxon_concept_names($taxon_concept_id); $he = new FlattenHierarchies(); $he->flatten_hierarchies_from_concept_id($taxon_concept_id); // make sure hierarchy info is up-to-date TaxonConcept::reindex_descendants_objects($taxon_concept_id); // make sure objects are indexed for display TaxonConcept::reindex_for_search($taxon_concept_id); // make sure objects are indexed for search }