function og_vocab_create_og_vocab in OG Vocabulary 7
Helper to easily create views-queries.
6 calls to og_vocab_create_og_vocab()
- OgVocabApiTestCase::testAutoCreateField in ./
og_vocab.test - Test creating of OG vocabuylary field when OG-vocab is saved.
- OgVocabApiTestCase::testLabelUrlCallbacks in ./
og_vocab.test - Test the entity_label() and entity_uri() callbacks.
- OgVocabComplexWidgetTestCase::setUp in ./
og_vocab.test - Sets up a Drupal site for running functional and integration tests.
- OgVocabMigrate::addOgVocab in includes/
migrate/ og_vocab.migrate.inc - Helper function to add the OG-vocab entity.
- OgVocabUnbindFromContentType::testUnbindContentType in ./
og_vocab.test - When a vocabulary is related to a bundle and it's term are reference to the group content, un-bind it from the bundle the terms should not be reference any more to the node.
File
- ./
og_vocab.module, line 278 - Give each group its own system controlled vocabularies.
Code
function og_vocab_create_og_vocab($vid, $entity_type, $bundle, $field_name = OG_VOCAB_FIELD, $settings = array()) {
$values = array(
'vid' => $vid,
'entity_type' => $entity_type,
'bundle' => $bundle,
'field_name' => $field_name,
'settings' => $settings,
);
$values['settings'] += array(
'required' => FALSE,
'widget_type' => 'options_select',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
);
return entity_create('og_vocab', $values);
}