function taxonomy_vocabulary_deploy in Deploy - Content Staging 6
Implementation of hook_deploy().
@todo At dependency checking for associated content types to make sure they exist remotely and/or are added at push time through a call to hook_taxonomy_vocabulary_deploy_check().
For reference here is a taxonomy vocabulary object.
[name] => test [description] => test [help] => test [nodes] => Array ( [booklist] => booklist [essay] => essay [letter] => letter ) [tags] => 1 [multiple] => 1 [required] => 1 [weight] => 4 [hierarchy] => 0 [relations] => 1 [vid] => 5
Parameters
$vid: Unique identifier for the vocabulary we're deploying.
Return value
The results of our remote call.
File
- modules/
taxonomy_deploy/ taxonomy_deploy.module, line 239 - Deployment API which enables modules to deploy items between servers.
Code
function taxonomy_vocabulary_deploy($vid) {
// If the vocabulary isn't there then bail.
$vocabulary = taxonomy_vocabulary_load($vid);
if (!$vocabulary) {
return FALSE;
}
// Normally, like with users and nodes, the uuid is added to the object in the 'load'
// op of their hook. Taxonomy terms and vocabs have no load op, so we have to
// get it by hand.
$uuid = deploy_uuid_get_vocabulary_uuid($vid);
$remote_key = deploy_get_remote_key($uuid, 'vocabulary');
$vocabulary->vid = isset($remote_key['vid']) ? $remote_key['vid'] : NULL;
$vocabulary->uuid = $uuid;
return deploy_send(array(
'taxonomy.saveVocabulary',
), array(
$vocabulary,
));
}