X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fentityqueue%2Fsrc%2FEntityQueueHandlerBase.php;fp=web%2Fmodules%2Fcontrib%2Fentityqueue%2Fsrc%2FEntityQueueHandlerBase.php;h=94cc9d2c77abea7d222ff70ebc7b34ddb48a91d2;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/entityqueue/src/EntityQueueHandlerBase.php b/web/modules/contrib/entityqueue/src/EntityQueueHandlerBase.php new file mode 100644 index 000000000..94cc9d2c7 --- /dev/null +++ b/web/modules/contrib/entityqueue/src/EntityQueueHandlerBase.php @@ -0,0 +1,131 @@ +configuration += $this->defaultConfiguration(); + } + + /** + * {@inheritdoc} + */ + public function getConfiguration() { + return $this->configuration; + } + + /** + * {@inheritdoc} + */ + public function setConfiguration(array $configuration) { + $this->configuration = $configuration; + } + + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return []; + } + + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + return []; + } + + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + return $form; + } + + /** + * {@inheritdoc} + */ + public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { + // Override this. + } + + /** + * {@inheritdoc} + */ + public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { + // Override this. + } + + /** + * {@inheritdoc} + */ + public function setQueue(EntityQueueInterface $queue) { + $this->queue = $queue; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getQueueListBuilderOperations() { + // Add an operation to list all subqueues by default. + $operations['view_subqueues'] = [ + 'title' => $this->t('View subqueues'), + 'weight' => -9, + 'url' => $this->queue->urlInfo('subqueue-list'), + ]; + + return $operations; + } + + /** + * {@inheritdoc} + */ + public function onQueuePreSave(EntityQueueInterface $queue, EntityStorageInterface $storage) { } + + /** + * {@inheritdoc} + */ + public function onQueuePostSave(EntityQueueInterface $queue, EntityStorageInterface $storage, $update = TRUE) { } + + /** + * {@inheritdoc} + */ + public function onQueuePreDelete(EntityQueueInterface $queue, EntityStorageInterface $storage) { } + + /** + * {@inheritdoc} + */ + public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage) { } + + /** + * {@inheritdoc} + */ + public function onQueuePostLoad(EntityQueueInterface $queue, EntityStorageInterface $storage) { } + +}