DataProviderTaxonomyTerm.php in RESTful 7.2
File
src/Plugin/resource/DataProvider/DataProviderTaxonomyTerm.php
View source
<?php
namespace Drupal\restful\Plugin\resource\DataProvider;
class DataProviderTaxonomyTerm extends DataProviderEntity implements DataProviderEntityInterface {
protected function setPropertyValues(\EntityDrupalWrapper $wrapper, $object, $replace = FALSE) {
$term = $wrapper
->value();
if (empty($term->vid)) {
$vocabulary = taxonomy_vocabulary_machine_name_load($term->vocabulary_machine_name);
$term->vid = $vocabulary->vid;
}
parent::setPropertyValues($wrapper, $object, $replace);
}
}