You are here

protected function RestfulEntityBaseTaxonomyTerm::setPropertyValues in RESTful 7

Overrides \RestfulEntityBase::setPropertyValues().

Set the "vid" property on new terms.

Overrides RestfulEntityBase::setPropertyValues

File

plugins/restful/RestfulEntityBaseTaxonomyTerm.php, line 19
Contains RestfulEntityBaseTaxonomyTerm.

Class

RestfulEntityBaseTaxonomyTerm
A base implementation for "Taxonomy term" entity type.

Code

protected function setPropertyValues(EntityMetadataWrapper $wrapper, $null_missing_fields = FALSE) {
  $term = $wrapper
    ->value();
  if (!empty($term->tid)) {
    return;
  }
  $vocabulary = taxonomy_vocabulary_machine_name_load($term->vocabulary_machine_name);
  $term->vid = $vocabulary->vid;
  parent::setPropertyValues($wrapper, $null_missing_fields);
}