*/
protected function widgetSelectorPluginCollection() {
if (!$this->widgetSelectorCollection) {
- $options = array();
+ $options = [];
foreach ($this->getWidgets()->getInstanceIds() as $id) {
$options[$id] = $this->getWidgets()->get($id)->label();
}
/**
* {@inheritdoc}
*/
- public function save() {
- $return = parent::save();
+ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
+ parent::postSave($storage, $update);
// Rebuild route information when browsers that register routes
// are created/updated.
- \Drupal::service('router.builder')->rebuild();
- return $return;
+ \Drupal::service('router.builder')->setRebuildNeeded();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function postDelete(EntityStorageInterface $storage, array $entities) {
+ parent::postDelete($storage, $entities);
+ // Rebuild route information when browsers that register routes
+ // are deleted.
+ \Drupal::service('router.builder')->setRebuildNeeded();
}
/**