Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values, $entity_type)
 {
     $this->pluginManager = \Drupal::service('plugin.manager.field.widget');
     parent::__construct($values, $entity_type);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function postSave(EntityStorageInterface $storage, $update = TRUE)
 {
     // Reset the render cache for the target entity type.
     parent::postSave($storage, $update);
     if (\Drupal::entityManager()->hasHandler($this->targetEntityType, 'view_builder')) {
         \Drupal::entityManager()->getViewBuilder($this->targetEntityType)->resetCache();
     }
 }