You are here

function party_starterkit_b2b_install in Party 8.2

Same name and namespace in other branches
  1. 7 starterkits/party_starterkit_b2b/party_starterkit_b2b.install \party_starterkit_b2b_install()

Implements hook_install().

File

starterkits/party_starterkit_b2b/party_starterkit_b2b.install, line 10
Party Starterkit B2B install file

Code

function party_starterkit_b2b_install() {

  // Create the taxonomy vocabulary
  $vocab = array(
    'name' => 'Organization Types',
    'machine_name' => 'party_org_types',
    'hierarchy' => 'single',
    'module' => 'party_starterkit_b2b',
  );
  $vocab = taxonomy_vocabulary_save((object) $vocab);
  party_starterkit_b2b_install_terms();

  // Create the relation types
  $employee_relation = relation_type_create(array(
    'relation_type' => 'employee',
    'label' => 'Employee of',
    'reverse_label' => 'Employs',
    'directional' => TRUE,
    'source_bundles' => array(
      'party:party',
    ),
    'target_bundles' => array(
      'party:party',
    ),
  ));
  relation_type_save($employee_relation);
  field_helper_install_all('party_starterkit_b2b');
}