diff --git a/modules/salesforce_mapping/src/Event/SalesforcePullEnqueueEvent.php b/modules/salesforce_mapping/src/Event/SalesforcePullEnqueueEvent.php index 3f324d300048c2f05926c9ea93adeab6da9f86fa..d428e67d4573990a6824483962ef5cc3c25eff0e 100644 --- a/modules/salesforce_mapping/src/Event/SalesforcePullEnqueueEvent.php +++ b/modules/salesforce_mapping/src/Event/SalesforcePullEnqueueEvent.php @@ -54,7 +54,7 @@ class SalesforcePullEnqueueEvent extends SalesforceBaseEvent { * @param SelectQueryResult $records * @param SObject $record */ - public function __construct(SalesforceMappingInterface $mapping, SelectQueryResult $records, SObject $record, $force_pull){ + public function __construct(SalesforceMappingInterface $mapping, SelectQueryResult $records, SObject $record, $force_pull) { $this->mapping = $mapping; $this->records = $records; $this->record = $record; diff --git a/modules/salesforce_pull/src/QueueHandler.php b/modules/salesforce_pull/src/QueueHandler.php index 3ed6843f38250f71f7046816347c5ba4c904c40d..66a4c9ff5a967c4e7e955bce0962b671a84363bc 100644 --- a/modules/salesforce_pull/src/QueueHandler.php +++ b/modules/salesforce_pull/src/QueueHandler.php @@ -289,7 +289,7 @@ class QueueHandler { $triggerField = $mapping->getPullTriggerDate(); try { foreach ($results->records() as $record) { - $event = $this->eventDispatcher->dispatch(new SalesforcePullEnqueueEvent($mapping, $results, $record), SalesforceEvents::PULL_ENQUEUE); + $event = $this->eventDispatcher->dispatch(new SalesforcePullEnqueueEvent($mapping, $results, $record, $force_pull), SalesforceEvents::PULL_ENQUEUE); if ($force_pull || $event->isEnqueueAllowed()) { $this->enqueueRecord($mapping, $record, $force_pull); } diff --git a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php index 497760d32d19e229420f2ff70d6e32ba792b69ba..bf1fa313c334084c501a5a19cd405588f2a32c41 100644 --- a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php +++ b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php @@ -220,6 +220,9 @@ class PullBaseTest extends UnitTestCase { $this->etm, $this->sfapi, $this->ed, + [], + 'cron_salesforce_pull', + ['cron' => ['time' => 180]], ]) ->getMock(); $this->pullWorker->expects($this->any()) diff --git a/src/Event/SalesforceEvents.php b/src/Event/SalesforceEvents.php index d443635720c1158c2592950f1d6273b12b2487c0..6877187d2b3f1fdc0e433b1d76c912f931125364 100644 --- a/src/Event/SalesforceEvents.php +++ b/src/Event/SalesforceEvents.php @@ -2,6 +2,8 @@ namespace Drupal\salesforce\Event; +use Drupal\salesforce_mapping\Event\SalesforcePullEnqueueEvent; + /** * Defines events for Salesforce. * @@ -151,6 +153,10 @@ final class SalesforceEvents { const PULL_ENTITY_VALUE = 'salesforce.pull_entity_value'; /** + * Dispatched immediately prior to queueing a Drupal entity to be pulled. + * + * Subscribers receive a + * Drupal\salesforce_mapping\Event\SalesforcePullEnqueueEvent instance. * * @Event *