You are here

function taxonomy_csv_vocabulary_create in Taxonomy CSV import/export 6.4

Same name and namespace in other branches
  1. 6.5 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
  2. 6.2 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
  3. 6.3 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
  4. 7.5 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()
  5. 7.4 taxonomy_csv.vocabulary.api.inc \taxonomy_csv_vocabulary_create()

Creates vocabulary by its name and returns vocabulary object.

Parameters

$name: (Optional) Name of vocabulary to create.

Return value

Created vocabulary object.

3 calls to taxonomy_csv_vocabulary_create()
taxonomy_csv_line_import in import/taxonomy_csv.import.line.api.inc
Process the import of items.
taxonomy_csv_vocabulary_duplicate in ./taxonomy_csv.vocabulary.api.inc
Duplicates a vocabulary object. If not exist, creates an empty vocabulary.
_taxonomy_csv_import_vocabulary_prepare in import/taxonomy_csv.import.api.inc
Prepare a vocabulary for import.

File

./taxonomy_csv.vocabulary.api.inc, line 17
Prepare and manage vocabularies.

Code

function taxonomy_csv_vocabulary_create($name = '') {
  $name = _taxonomy_csv_vocabulary_name_create($name);

  // Create an empty vocabulary. Relations and hierarchy are updated later.
  $vocabulary = array(
    'name' => $name,
    'description' => t('Vocabulary created automatically by Taxonomy csv import/export module'),
    'help' => '',
    'relations' => TRUE,
    'hierarchy' => 2,
    'multiple' => TRUE,
    'required' => FALSE,
    'tags' => FALSE,
    'module' => 'taxonomy',
    'weight' => 0,
    'nodes' => array(),
  );
  $result = taxonomy_save_vocabulary($vocabulary);
  return taxonomy_csv_vocabulary_load_name($vocabulary['name']);
}