I'm currently developing a module which provides a content type called "Structural machinery" . This type should also provide a taxonomy term based on different manufacturers providing the machine (eg CAT or Komatsu) , I know how to create a taxonomy vocabulary programmatically but the question is how to attach a taxonomy field to my bundle.
this is the code used to implement the taxonomy term :
$term = new stdClass();
$term -> name = $t('Manufacture');
$term -> machine_name = 'manufacture';
$term -> description = $t('Description');
$term -> hierarchy = 2;
$term -> module = 'construction_machinery';
$term -> weight = 1;
taxonomy_vocabulary_save($term);