class SalesforcePullEvent in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/Event/SalesforcePullEvent.php \Drupal\salesforce_mapping\Event\SalesforcePullEvent
- 8.3 modules/salesforce_mapping/src/Event/SalesforcePullEvent.php \Drupal\salesforce_mapping\Event\SalesforcePullEvent
Salesforce pull event.
Hierarchy
- class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\salesforce\Event\SalesforceBaseEvent
- class \Drupal\salesforce_mapping\Event\SalesforcePullEvent
- class \Drupal\salesforce\Event\SalesforceBaseEvent
Expanded class hierarchy of SalesforcePullEvent
4 files declare their use of SalesforcePullEvent
- MappedObject.php in modules/
salesforce_mapping/ src/ Entity/ MappedObject.php - PullBase.php in modules/
salesforce_pull/ src/ Plugin/ QueueWorker/ PullBase.php - PullBaseTest.php in modules/
salesforce_pull/ tests/ src/ Unit/ PullBaseTest.php - SalesforceExampleSubscriber.php in modules/
salesforce_example/ src/ EventSubscriber/ SalesforceExampleSubscriber.php
File
- modules/
salesforce_mapping/ src/ Event/ SalesforcePullEvent.php, line 11
Namespace
Drupal\salesforce_mapping\EventView source
class SalesforcePullEvent extends SalesforceBaseEvent {
/**
* The mapping responsible for this pull.
*
* @var \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface
*/
protected $mapping;
/**
* The mapped object associated with this pull.
*
* @var \Drupal\salesforce_mapping\Entity\MappedObjectInterface
*/
protected $mappedObject;
/**
* The Drupal entity into which the data is being pulled.
*
* @var \Drupal\Core\Entity\FieldableEntityInterface
*/
protected $entity;
/**
* The pull operation.
*
* One of:
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_CREATE
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_UPDATE
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_DELETE.
*
* @var string
*/
protected $op;
/**
* TRUE or FALSE to indicate if pull is allowed for this event.
*
* @var bool
*/
protected $pullAllowed;
/**
* SalesforcePullEvent constructor.
*
* @param \Drupal\salesforce_mapping\Entity\MappedObjectInterface $mappedObject
* The mapped object.
* @param string $op
* The operation.
*/
public function __construct(MappedObjectInterface $mappedObject, $op) {
$this->mappedObject = $mappedObject;
$this->entity = $mappedObject
->getMappedEntity();
$this->mapping = $mappedObject
->getMapping();
$this->op = $op;
$this->pullAllowed = TRUE;
}
/**
* Getter.
*
* @return \Drupal\Core\Entity\FieldableEntityInterface
* The entity.
*/
public function getEntity() {
return $this->entity;
}
/**
* Getter.
*
* @return \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface
* The mapping interface.
*/
public function getMapping() {
return $this->mapping;
}
/**
* Getter.
*
* @return \Drupal\salesforce_mapping\Entity\MappedObjectInterface
* The mapped object.
*/
public function getMappedObject() {
return $this->mappedObject;
}
/**
* Getter for the pull operation.
*
* One of:
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_CREATE
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_UPDATE
* \Drupal\salesforce_mapping\MappingConstants::SALESFORCE_MAPPING_SYNC_SF_DELETE.
*
* @return string
* The op.
*/
public function getOp() {
return $this->op;
}
/**
* Disallow and stop pull for the current queue item.
*/
public function disallowPull() {
$this->pullAllowed = FALSE;
return $this;
}
/**
* Will return FALSE if any subscribers have called disallowPull().
*
* @return bool
* TRUE if pull is allowed, false otherwise.
*/
public function isPullAllowed() {
return $this->pullAllowed;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SalesforcePullEvent:: |
protected | property | The Drupal entity into which the data is being pulled. | |
SalesforcePullEvent:: |
protected | property | The mapped object associated with this pull. | |
SalesforcePullEvent:: |
protected | property | The mapping responsible for this pull. | |
SalesforcePullEvent:: |
protected | property | The pull operation. | |
SalesforcePullEvent:: |
protected | property | TRUE or FALSE to indicate if pull is allowed for this event. | |
SalesforcePullEvent:: |
public | function | Disallow and stop pull for the current queue item. | |
SalesforcePullEvent:: |
public | function | Getter. | |
SalesforcePullEvent:: |
public | function | Getter. | |
SalesforcePullEvent:: |
public | function | Getter. | |
SalesforcePullEvent:: |
public | function | Getter for the pull operation. | |
SalesforcePullEvent:: |
public | function | Will return FALSE if any subscribers have called disallowPull(). | |
SalesforcePullEvent:: |
public | function | SalesforcePullEvent constructor. |