class SalesforcePushAllowedEvent in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 modules/salesforce_mapping/src/Event/SalesforcePushAllowedEvent.php \Drupal\salesforce_mapping\Event\SalesforcePushAllowedEvent
- 5.0.x modules/salesforce_mapping/src/Event/SalesforcePushAllowedEvent.php \Drupal\salesforce_mapping\Event\SalesforcePushAllowedEvent
Push allowed event.
Hierarchy
- class \Drupal\salesforce\Event\SalesforceBaseEvent extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\salesforce_mapping\Event\SalesforcePushEvent
- class \Drupal\salesforce_mapping\Event\SalesforcePushOpEvent
- class \Drupal\salesforce_mapping\Event\SalesforcePushAllowedEvent
- class \Drupal\salesforce_mapping\Event\SalesforcePushOpEvent
- class \Drupal\salesforce_mapping\Event\SalesforcePushEvent
Expanded class hierarchy of SalesforcePushAllowedEvent
2 files declare their use of SalesforcePushAllowedEvent
- SalesforceExampleSubscriber.php in modules/
salesforce_example/ src/ EventSubscriber/ SalesforceExampleSubscriber.php - salesforce_push.module in modules/
salesforce_push/ salesforce_push.module - Push updates to Salesforce when a Drupal entity is updated.
File
- modules/
salesforce_mapping/ src/ Event/ SalesforcePushAllowedEvent.php, line 10
Namespace
Drupal\salesforce_mapping\EventView source
class SalesforcePushAllowedEvent extends SalesforcePushOpEvent {
/**
* Indicates whether push is allowed to continue.
*
* @var bool
*/
protected $pushAllowed;
/**
* SalesforcePushAllowedEvent dispatched before building PushParams.
*
* @param \Drupal\salesforce_mapping\Entity\MappedObjectInterface $mapped_object
* The mapped object.
* @param string $op
* One of
* Drupal\salesforce_mapping\MappingConstants::
* SALESFORCE_MAPPING_SYNC_DRUPAL_CREATE
* SALESFORCE_MAPPING_SYNC_DRUPAL_UPDATE
* SALESFORCE_MAPPING_SYNC_DRUPAL_DELETE.
*/
public function __construct(MappedObjectInterface $mapped_object, $op) {
parent::__construct($mapped_object, $op);
$this->op = $op;
}
/**
* Returns FALSE if push is disallowed.
*
* Note: a subscriber cannot "force" a push when any other subscriber has
* disallowed it.
*
* @return false|null
* Returns FALSE if PUSH_ALLOWED event has been fired, and any subscriber
* wants to prevent push. Otherwise, returns NULL.
*/
public function isPushAllowed() {
return $this->pushAllowed === FALSE ? FALSE : NULL;
}
/**
* Stop Salesforce record from being pushed.
*
* @return $this
*/
public function disallowPush() {
$this->pushAllowed = FALSE;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SalesforcePushAllowedEvent:: |
protected | property | Indicates whether push is allowed to continue. | |
SalesforcePushAllowedEvent:: |
public | function | Stop Salesforce record from being pushed. | |
SalesforcePushAllowedEvent:: |
public | function | Returns FALSE if push is disallowed. | |
SalesforcePushAllowedEvent:: |
public | function |
SalesforcePushAllowedEvent dispatched before building PushParams. Overrides SalesforcePushOpEvent:: |
|
SalesforcePushEvent:: |
protected | property | The Drupal entity. | |
SalesforcePushEvent:: |
protected | property | The mapped object. | |
SalesforcePushEvent:: |
protected | property | The mapping. | |
SalesforcePushEvent:: |
public | function | Getter. | |
SalesforcePushEvent:: |
public | function | Getter. | |
SalesforcePushEvent:: |
public | function | Getter. | |
SalesforcePushOpEvent:: |
protected | property | The pull operation. | |
SalesforcePushOpEvent:: |
public | function | Getter for the pull operation. |