/** * Creates a new NodeType instance. * * @param EntityManagerInterface $entity_manager * The entity manager. * @param array $configuration * The plugin configuration, i.e. an array with configuration values keyed * by configuration option name. The special key 'context' may be used to * initialize the defined contexts by setting it to an array of context * values keyed by context names. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. */ public function __construct(EntityManagerInterface $entity_manager, array $configuration, $plugin_id, $plugin_definition) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityStorage = $entity_manager->getStorage($this->getDerivativeId()); $this->bundleType = $entity_manager->getDefinition($this->getDerivativeId()); $this->bundleOf = $entity_manager->getDefinition($this->bundleType->getBundleOf()); }