Loading src/SchedulerManager.php +2 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ class SchedulerManager { $query->accessCheck(FALSE); // If the entity type is revisionable then make sure we look for the // latest revision. This is important for moderated entities. if ($this->entityTypeManager->getDefinition($entityTypeId)->isRevisionable()) { if ($plugin->entityTypeObject()->isRevisionable()) { $query->latestRevision(); } $ids = $query->execute(); Loading Loading @@ -474,7 +474,7 @@ class SchedulerManager { $query->accessCheck(FALSE); // If the entity type is revisionable then make sure we look for the // latest revision. This is important for moderated entities. if ($this->entityTypeManager->getDefinition($entityTypeId)->isRevisionable()) { if ($plugin->entityTypeObject()->isRevisionable()) { $query->latestRevision(); } $ids = $query->execute(); Loading src/SchedulerPluginBase.php +23 −10 Original line number Diff line number Diff line Loading @@ -18,6 +18,13 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin */ protected $entityTypeManager; /** * The entity type object for this plugin. * * @var Drupal\Core\Config\Entity\ConfigEntityType */ protected $entityTypeObject; /** * A static cache of create/edit entity form IDs. * Loading @@ -38,6 +45,8 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static($configuration, $plugin_id, $plugin_definition); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->entityTypeObject = $instance->entityTypeManager ->getDefinition($plugin_definition['entityType']); return $instance; } Loading Loading @@ -71,6 +80,16 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return $this->pluginDefinition['entityType']; } /** * Get the entity type object supported by this plugin. * * @return Drupal\Core\Config\Entity\ConfigEntityType * The entity type object. */ public function entityTypeObject() { return $this->entityTypeObject; } /** * Get module dependency. * Loading Loading @@ -160,9 +179,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin * The name of the type/bundle field for this entity type. */ public function typeFieldName() { return $this->entityTypeManager ->getDefinition($this->entityType()) ->getKey('bundle'); return $this->entityTypeObject->getKey('bundle'); } /** Loading @@ -172,12 +189,10 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin * The type/bundle objects, keyed by type/bundle name. */ public function getTypes() { $bundleDefinition = $this->entityTypeManager ->getDefinition($this->entityType()) ->getBundleEntityType(); $bundleEntityType = $this->entityTypeObject->getBundleEntityType(); return $this->entityTypeManager ->getStorage($bundleDefinition) ->getStorage($bundleEntityType) ->loadMultiple(); } Loading @@ -200,9 +215,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return $this->entityTypeFormIds; } $bundleEntityType = $this->entityTypeManager ->getDefinition($this->entityType()) ->getBundleEntityType(); $bundleEntityType = $this->entityTypeObject->getBundleEntityType(); return $this->entityTypeFormIds = $this->entityFormIdsByType($bundleEntityType, TRUE); } Loading Loading
src/SchedulerManager.php +2 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ class SchedulerManager { $query->accessCheck(FALSE); // If the entity type is revisionable then make sure we look for the // latest revision. This is important for moderated entities. if ($this->entityTypeManager->getDefinition($entityTypeId)->isRevisionable()) { if ($plugin->entityTypeObject()->isRevisionable()) { $query->latestRevision(); } $ids = $query->execute(); Loading Loading @@ -474,7 +474,7 @@ class SchedulerManager { $query->accessCheck(FALSE); // If the entity type is revisionable then make sure we look for the // latest revision. This is important for moderated entities. if ($this->entityTypeManager->getDefinition($entityTypeId)->isRevisionable()) { if ($plugin->entityTypeObject()->isRevisionable()) { $query->latestRevision(); } $ids = $query->execute(); Loading
src/SchedulerPluginBase.php +23 −10 Original line number Diff line number Diff line Loading @@ -18,6 +18,13 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin */ protected $entityTypeManager; /** * The entity type object for this plugin. * * @var Drupal\Core\Config\Entity\ConfigEntityType */ protected $entityTypeObject; /** * A static cache of create/edit entity form IDs. * Loading @@ -38,6 +45,8 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static($configuration, $plugin_id, $plugin_definition); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->entityTypeObject = $instance->entityTypeManager ->getDefinition($plugin_definition['entityType']); return $instance; } Loading Loading @@ -71,6 +80,16 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return $this->pluginDefinition['entityType']; } /** * Get the entity type object supported by this plugin. * * @return Drupal\Core\Config\Entity\ConfigEntityType * The entity type object. */ public function entityTypeObject() { return $this->entityTypeObject; } /** * Get module dependency. * Loading Loading @@ -160,9 +179,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin * The name of the type/bundle field for this entity type. */ public function typeFieldName() { return $this->entityTypeManager ->getDefinition($this->entityType()) ->getKey('bundle'); return $this->entityTypeObject->getKey('bundle'); } /** Loading @@ -172,12 +189,10 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin * The type/bundle objects, keyed by type/bundle name. */ public function getTypes() { $bundleDefinition = $this->entityTypeManager ->getDefinition($this->entityType()) ->getBundleEntityType(); $bundleEntityType = $this->entityTypeObject->getBundleEntityType(); return $this->entityTypeManager ->getStorage($bundleDefinition) ->getStorage($bundleEntityType) ->loadMultiple(); } Loading @@ -200,9 +215,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin return $this->entityTypeFormIds; } $bundleEntityType = $this->entityTypeManager ->getDefinition($this->entityType()) ->getBundleEntityType(); $bundleEntityType = $this->entityTypeObject->getBundleEntityType(); return $this->entityTypeFormIds = $this->entityFormIdsByType($bundleEntityType, TRUE); } Loading