class SalesforceMapping in Salesforce Suite 8.3
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping
- 5.0.x modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping
Defines a Salesforce Mapping configuration entity class.
Plugin annotation
@ConfigEntityType(
id = "salesforce_mapping",
label = @Translation("Salesforce Mapping"),
module = "salesforce_mapping",
handlers = {
"storage" = "Drupal\salesforce_mapping\SalesforceMappingStorage",
"view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
"access" = "Drupal\salesforce_mapping\SalesforceMappingAccessController",
"list_builder" = "Drupal\salesforce_mapping\SalesforceMappingList",
"form" = {
"add" = "Drupal\salesforce_mapping\Form\SalesforceMappingAddForm",
"edit" = "Drupal\salesforce_mapping\Form\SalesforceMappingEditForm",
"disable" = "Drupal\salesforce_mapping\Form\SalesforceMappingDisableForm",
"delete" = "Drupal\salesforce_mapping\Form\SalesforceMappingDeleteForm",
"enable" = "Drupal\salesforce_mapping\Form\SalesforceMappingEnableForm",
"fields" = "Drupal\salesforce_mapping\Form\SalesforceMappingFieldsForm",
}
},
admin_permission = "administer salesforce mapping",
entity_keys = {
"id" = "id",
"label" = "label",
"weight" = "weight",
},
links = {
"edit-form" = "/admin/structure/salesforce/mappings/manage/{salesforce_mapping}",
"delete-form" = "/admin/structure/salesforce/mappings/manage/{salesforce_mapping}/delete"
},
config_export = {
"id",
"label",
"weight",
"type",
"key",
"async",
"push_standalone",
"pull_standalone",
"pull_trigger_date",
"pull_where_clause",
"sync_triggers",
"salesforce_object_type",
"drupal_entity_type",
"drupal_bundle",
"field_mappings",
"push_limit",
"push_retries",
"push_frequency",
"pull_frequency",
"always_upsert"
},
lookup_keys = {
"drupal_entity_type",
"drupal_bundle",
"salesforce_object_type"
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
- class \Drupal\salesforce_mapping\Entity\SalesforceMapping implements SalesforceMappingInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of SalesforceMapping
5 files declare their use of SalesforceMapping
- PushParamsTest.php in modules/
salesforce_mapping/ tests/ src/ Functional/ PushParamsTest.php - PushQueueTest.php in modules/
salesforce_push/ tests/ src/ Functional/ PushQueueTest.php - SalesforceMappingStorageTest.php in modules/
salesforce_mapping/ tests/ src/ Unit/ SalesforceMappingStorageTest.php - SalesforceMappingTest.php in modules/
salesforce_mapping/ tests/ src/ Unit/ SalesforceMappingTest.php - salesforce_mapping.install in modules/
salesforce_mapping/ salesforce_mapping.install - Install file.
File
- modules/
salesforce_mapping/ src/ Entity/ SalesforceMapping.php, line 72
Namespace
Drupal\salesforce_mapping\EntityView source
class SalesforceMapping extends ConfigEntityBase implements SalesforceMappingInterface {
/**
* Only one bundle type for now.
*
* @var string
*/
protected $type = 'salesforce_mapping';
/**
* ID (machine name) of the Mapping.
*
* @var string
*
* @note numeric id was removed
*/
protected $id;
/**
* Label of the Mapping.
*
* @var string
*/
protected $label;
/**
* The UUID for this entity.
*
* @var string
*/
protected $uuid;
/**
* A default weight for the mapping.
*
* @var int
*/
protected $weight = 0;
/**
* Whether to push asychronous.
*
* - If true, disable real-time push.
* - If false (default), attempt real-time push and enqueue failures for
* async push.
*
* Note this is different behavior compared to D7.
*
* @var bool
*/
protected $async = FALSE;
/**
* Whether a standalone push endpoint is enabled for this mapping.
*
* @var bool
*/
protected $push_standalone = FALSE;
/**
* Whether a standalone push endpoint is enabled for this mapping.
*
* @var bool
*/
protected $pull_standalone = FALSE;
/**
* The Salesforce field to use for determining whether or not to pull.
*
* @var string
*/
protected $pull_trigger_date = 'LastModifiedDate';
/**
* Additional "where" logic to append to pull-polling query.
*
* @var string
*/
protected $pull_where_clause = '';
/**
* The drupal entity type to which this mapping points.
*
* @var string
*/
protected $drupal_entity_type;
/**
* The drupal entity bundle to which this mapping points.
*
* @var string
*/
protected $drupal_bundle;
/**
* The salesforce object type to which this mapping points.
*
* @var string
*/
protected $salesforce_object_type;
/**
* Salesforce field name for upsert key, if set. Otherwise FALSE.
*
* @var string
*/
protected $key;
/**
* If TRUE, always use "upsert" to push data to Salesforce.
*
* Otherwise use "upsert" only if upsert key is set and SFID is not available.
*
* @var bool
*/
protected $always_upsert;
/**
* Mapped field plugins.
*
* @var \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface[]
*/
protected $field_mappings = [];
/**
* Active sync triggers.
*
* @var array
*/
protected $sync_triggers = [];
/**
* Stateful push data for this mapping.
*
* @var array
*/
protected $push_info;
/**
* Statefull pull data for this mapping.
*
* @var array
*/
protected $pull_info;
/**
* How often (in seconds) to push with this mapping.
*
* @var int
*/
protected $push_frequency = 0;
/**
* Maxmimum number of records to push during a batch.
*
* @var int
*/
protected $push_limit = 0;
/**
* Maximum number of attempts to push a record before it's considered failed.
*
* @var string
*/
protected $push_retries = 3;
/**
* How often (in seconds) to pull with this mapping.
*
* @var int
*/
protected $pull_frequency = 0;
/**
* {@inheritdoc}
*/
public function __construct(array $values, $entity_type) {
parent::__construct($values, $entity_type);
$push_info = $this
->state()
->get('salesforce.mapping_push_info', []);
if (empty($push_info[$this
->id()])) {
$push_info[$this
->id()] = [
'last_timestamp' => 0,
];
}
$this->push_info = $push_info[$this
->id()];
$pull_info = $this
->state()
->get('salesforce.mapping_pull_info', []);
if (empty($pull_info[$this
->id()])) {
$pull_info[$this
->id()] = [
'last_pull_timestamp' => 0,
'last_delete_timestamp' => 0,
];
}
$this->pull_info = $pull_info[$this
->id()];
}
/**
* {@inheritdoc}
*/
public function __get($key) {
return $this->{$key};
}
/**
* Save the entity.
*
* @return object
* The newly saved version of the entity.
*/
public function save() {
$this->updated = $this
->getRequestTime();
if (isset($this->is_new) && $this->is_new) {
$this->created = $this
->getRequestTime();
}
return parent::save();
}
/**
* Testable func to return the request time server variable.
*
* @return int
* The request time.
*/
protected function getRequestTime() {
return \Drupal::time()
->getRequestTime();
}
/**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
// Update shared pull values across other mappings to same object type.
$pull_mappings = $storage
->loadByProperties([
'salesforce_object_type' => $this->salesforce_object_type,
]);
unset($pull_mappings[$this
->id()]);
foreach ($pull_mappings as $mapping) {
if ($this->pull_frequency != $mapping->pull_frequency) {
$mapping->pull_frequency = $this->pull_frequency;
$mapping
->save();
}
}
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
// Include config dependencies on all mapped Drupal fields.
foreach ($this
->getFieldMappings() as $field) {
foreach ($field
->getDependencies($this) as $type => $deps) {
foreach ($deps as $dep) {
$this
->addDependency($type, $dep);
}
}
}
if ($this
->doesPull()) {
$this
->addDependency('module', 'salesforce_pull');
}
if ($this
->doesPush()) {
$this
->addDependency('module', 'salesforce_push');
}
return $this;
}
/**
* {@inheritdoc}
*/
public function getPullFields() {
// @TODO This should probably be delegated to a field plugin bag?
$fields = [];
foreach ($this
->getFieldMappings() as $field_plugin) {
// Skip fields that aren't being pulled from Salesforce.
if (!$field_plugin
->pull()) {
continue;
}
$fields[] = $field_plugin;
}
return $fields;
}
/**
* {@inheritdoc}
*/
public function getPullFieldsArray() {
return array_column($this->field_mappings, 'salesforce_field', 'salesforce_field');
}
/**
* {@inheritdoc}
*/
public function getKeyField() {
return $this->key ? $this->key : FALSE;
}
/**
* {@inheritdoc}
*/
public function hasKey() {
return $this->key ? TRUE : FALSE;
}
/**
* {@inheritdoc}
*/
public function getKeyValue(EntityInterface $entity) {
if (!$this
->hasKey()) {
throw new \Exception('No key defined for this mapping.');
}
// @TODO #fieldMappingField
foreach ($this
->getFieldMappings() as $field_plugin) {
if ($field_plugin
->get('salesforce_field') == $this
->getKeyField()) {
return $field_plugin
->value($entity, $this);
}
}
throw new \Exception(t('Key %key not found for this mapping.', [
'%key' => $this
->getKeyField(),
]));
}
/**
* {@inheritdoc}
*/
public function getSalesforceObjectType() {
return $this->salesforce_object_type;
}
/**
* {@inheritdoc}
*/
public function getDrupalEntityType() {
return $this->drupal_entity_type;
}
/**
* {@inheritdoc}
*/
public function getDrupalBundle() {
return $this->drupal_bundle;
}
/**
* {@inheritdoc}
*/
public function getFieldMappings() {
// @TODO #fieldMappingField
$fields = [];
foreach ($this->field_mappings as $field) {
$fields[] = $this
->fieldManager()
->createInstance($field['drupal_field_type'], $field);
}
return $fields;
}
/**
* {@inheritdoc}
*/
public function getFieldMapping(array $field) {
return $this
->fieldManager()
->createInstance($field['drupal_field_type'], $field['config']);
}
/**
* {@inheritdoc}
*/
public function getPullTriggerDate() {
return $this->pull_trigger_date;
}
/**
* {@inheritdoc}
*/
public function doesPushStandalone() {
return $this->push_standalone;
}
/**
* {@inheritdoc}
*/
public function doesPullStandalone() {
return $this->pull_standalone;
}
/**
* {@inheritdoc}
*/
public function doesPush() {
return $this
->checkTriggers([
MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_CREATE,
MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_UPDATE,
MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_DELETE,
]);
}
/**
* {@inheritdoc}
*/
public function doesPull() {
return $this
->checkTriggers([
MappingConstants::SALESFORCE_MAPPING_SYNC_SF_CREATE,
MappingConstants::SALESFORCE_MAPPING_SYNC_SF_UPDATE,
MappingConstants::SALESFORCE_MAPPING_SYNC_SF_DELETE,
]);
}
/**
* {@inheritdoc}
*/
public function checkTriggers(array $triggers) {
foreach ($triggers as $trigger) {
if (!empty($this->sync_triggers[$trigger])) {
return TRUE;
}
}
return FALSE;
}
/**
* Returns the name of this configuration object.
*
* @return string
* The name of the configuration object.
*/
public function getName() {
return $this->name;
}
/**
* {@inheritdoc}
*/
public function getLastDeleteTime() {
return $this->pull_info['last_delete_timestamp'] ? $this->pull_info['last_delete_timestamp'] : NULL;
}
/**
* {@inheritdoc}
*/
public function setLastDeleteTime($time) {
return $this
->setPullInfo('last_delete_timestamp', $time);
}
/**
* {@inheritdoc}
*/
public function getLastPullTime() {
return $this->pull_info['last_pull_timestamp'] ? $this->pull_info['last_pull_timestamp'] : NULL;
}
/**
* {@inheritdoc}
*/
public function setLastPullTime($time) {
return $this
->setPullInfo('last_pull_timestamp', $time);
}
/**
* Setter for pull info.
*
* @param string $key
* The config id to set.
* @param mixed $value
* The value.
*
* @return $this
*/
protected function setPullInfo($key, $value) {
$this->pull_info[$key] = $value;
$pull_info = $this
->state()
->get('salesforce.mapping_pull_info');
$pull_info[$this
->id()] = $this->pull_info;
$this
->state()
->set('salesforce.mapping_pull_info', $pull_info);
return $this;
}
/**
* {@inheritdoc}
*/
public function getNextPullTime() {
return $this->pull_info['last_pull_timestamp'] + $this->pull_frequency;
}
/**
* {@inheritdoc}
*/
public function getLastPushTime() {
return $this->push_info['last_timestamp'];
}
/**
* {@inheritdoc}
*/
public function setLastPushTime($time) {
return $this
->setPushInfo('last_timestamp', $time);
}
/**
* Setter for pull info.
*
* @param string $key
* The config id to set.
* @param mixed $value
* The value.
*
* @return $this
*/
protected function setPushInfo($key, $value) {
$this->push_info[$key] = $value;
$push_info = $this
->state()
->get('salesforce.mapping_push_info');
$push_info[$this
->id()] = $this->push_info;
$this
->state()
->set('salesforce.mapping_push_info', $push_info);
return $this;
}
/**
* {@inheritdoc}
*/
public function getNextPushTime() {
return $this->push_info['last_timestamp'] + $this->push_frequency;
}
/**
* {@inheritdoc}
*/
public function getPullQuery(array $mapped_fields = [], $start = 0, $stop = 0) {
if (!$this
->doesPull()) {
throw new Exception('Mapping does not pull.');
}
$object_type = $this
->getSalesforceObjectType();
$soql = new SelectQuery($object_type);
// Convert field mappings to SOQL.
if (empty($mapped_fields)) {
$mapped_fields = $this
->getPullFieldsArray();
}
$soql->fields = $mapped_fields;
$soql->fields[] = 'Id';
$soql->fields[] = $this
->getPullTriggerDate();
$start = $start > 0 ? $start : $this
->getLastPullTime();
// If no lastupdate and no start window provided, get all records.
if ($start) {
$start = gmdate('Y-m-d\\TH:i:s\\Z', $start);
$soql
->addCondition($this
->getPullTriggerDate(), $start, '>');
}
if ($stop) {
$stop = gmdate('Y-m-d\\TH:i:s\\Z', $stop);
$soql
->addCondition($this
->getPullTriggerDate(), $stop, '<');
}
if (!empty($this->pull_where_clause)) {
$soql->conditions[] = [
$this->pull_where_clause,
];
}
$soql->order[$this
->getPullTriggerDate()] = 'ASC';
return $soql;
}
/**
* {@inheritdoc}
*/
public function alwaysUpsert() {
return $this
->hasKey() && !empty($this->always_upsert);
}
/**
* Salesforce Mapping Field Manager service.
*
* @return \Drupal\salesforce_mapping\SalesforceMappingFieldPluginManager
* The plugin.manager.salesforce_mapping_field service.
*/
protected function fieldManager() {
return \Drupal::service('plugin.manager.salesforce_mapping_field');
}
/**
* Salesforce API client service.
*
* @return \Drupal\salesforce\Rest\RestClient
* The salesforce.client service.
*/
protected function client() {
return \Drupal::service('salesforce.client');
}
/**
* State service.
*
* @return \Drupal\Core\State\StateInterface
* The state service.
*/
protected function state() {
return \Drupal::state();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ConfigEntityBase:: |
private | property | Whether the config is being deleted by the uninstall process. | |
ConfigEntityBase:: |
protected | property | The language code of the entity's default language. | |
ConfigEntityBase:: |
protected | property | The original ID of the configuration entity. | |
ConfigEntityBase:: |
protected | property | The enabled/disabled status of the configuration entity. | 4 |
ConfigEntityBase:: |
protected | property | Third party entity settings. | |
ConfigEntityBase:: |
protected | property | Trust supplied data and not use configuration schema on save. | |
ConfigEntityBase:: |
protected | property | Information maintained by Drupal core about configuration. | |
ConfigEntityBase:: |
protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
ConfigEntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Disables the configuration entity. Overrides ConfigEntityInterface:: |
1 |
ConfigEntityBase:: |
public | function |
Enables the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected static | function | Gets the configuration manager. | |
ConfigEntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the configuration dependencies. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
protected | function | Gets the typed config manager. | |
ConfigEntityBase:: |
public | function |
Gets whether on not the data is trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
protected static | function |
Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected | function |
Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Checks whether this entity is installable. Overrides ConfigEntityInterface:: |
2 |
ConfigEntityBase:: |
public | function |
Overrides Entity::isNew(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface:: |
7 |
ConfigEntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase:: |
8 |
ConfigEntityBase:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides EntityBase:: |
13 |
ConfigEntityBase:: |
public | function |
Sets the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets the status of the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function | ||
ConfigEntityBase:: |
public static | function | Helper callback for uasort() to sort configuration entities by weight and label. | 6 |
ConfigEntityBase:: |
public | function |
Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface:: |
4 |
ConfigEntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityBase:: |
2 |
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets that the data should be trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Unsets a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Overrides EntityBase:: |
4 |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. Aliased as: addDependencyTrait | |
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |
1 |
EntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the identifier. Overrides EntityInterface:: |
11 |
EntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityInterface:: |
6 |
EntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface:: |
16 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
EntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets an array of placeholders for this entity. | 2 |
EntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
PluginDependencyTrait:: |
protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 |
PluginDependencyTrait:: |
protected | function | Calculates and returns dependencies of a specific plugin instance. | |
PluginDependencyTrait:: |
protected | function | Wraps the module handler. | 1 |
PluginDependencyTrait:: |
protected | function | Wraps the theme handler. | 1 |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
SalesforceMapping:: |
protected | property | If TRUE, always use "upsert" to push data to Salesforce. | |
SalesforceMapping:: |
protected | property | Whether to push asychronous. | |
SalesforceMapping:: |
protected | property | The drupal entity bundle to which this mapping points. | |
SalesforceMapping:: |
protected | property | The drupal entity type to which this mapping points. | |
SalesforceMapping:: |
protected | property | Mapped field plugins. | |
SalesforceMapping:: |
protected | property | ID (machine name) of the Mapping. | |
SalesforceMapping:: |
protected | property | Salesforce field name for upsert key, if set. Otherwise FALSE. | |
SalesforceMapping:: |
protected | property | Label of the Mapping. | |
SalesforceMapping:: |
protected | property | How often (in seconds) to pull with this mapping. | |
SalesforceMapping:: |
protected | property | Statefull pull data for this mapping. | |
SalesforceMapping:: |
protected | property | Whether a standalone push endpoint is enabled for this mapping. | |
SalesforceMapping:: |
protected | property | The Salesforce field to use for determining whether or not to pull. | |
SalesforceMapping:: |
protected | property | Additional "where" logic to append to pull-polling query. | |
SalesforceMapping:: |
protected | property | How often (in seconds) to push with this mapping. | |
SalesforceMapping:: |
protected | property | Stateful push data for this mapping. | |
SalesforceMapping:: |
protected | property | Maxmimum number of records to push during a batch. | |
SalesforceMapping:: |
protected | property | Maximum number of attempts to push a record before it's considered failed. | |
SalesforceMapping:: |
protected | property | Whether a standalone push endpoint is enabled for this mapping. | |
SalesforceMapping:: |
protected | property | The salesforce object type to which this mapping points. | |
SalesforceMapping:: |
protected | property | Active sync triggers. | |
SalesforceMapping:: |
protected | property | Only one bundle type for now. | |
SalesforceMapping:: |
protected | property |
The UUID for this entity. Overrides ConfigEntityBase:: |
|
SalesforceMapping:: |
protected | property | A default weight for the mapping. | |
SalesforceMapping:: |
public | function |
Return TRUE if this mapping should always use upsert over create or update. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase:: |
|
SalesforceMapping:: |
public | function |
Checks if mapping has any of the given triggers. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
protected | function | Salesforce API client service. | |
SalesforceMapping:: |
public | function |
Checks mappings for any pull operation. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Getter for push_standalone property. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Checks mappings for any push operation. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Getter for push_standalone property. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
protected | function | Salesforce Mapping Field Manager service. | |
SalesforceMapping:: |
public | function |
Get the Drupal bundle name for this mapping, e.g. "article". Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Get the Drupal entity type name for this mapping, e.g. "node". Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Given a field config, create an instance of a field mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Get all the mapped field plugins for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Return name of the Salesforce field which is the upsert key. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Given a Drupal entity, get the value to be upserted. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Return the timestamp for the date of most recent delete processing. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Return the timestamp for the date of most recent pull processing. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Returns a timstamp when the push queue was last processed for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function | Returns the name of this configuration object. | |
SalesforceMapping:: |
public | function |
Get the timestamp when the next pull should be processed for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Get the timestamp when the next push should be processed for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Get all the field plugins which are configured to pull from Salesforce. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Get a flat array of the field plugins which are configured to pull. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Generate a select query to pull records from Salesforce for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
The Salesforce date field which determines whether to pull. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
protected | function | Testable func to return the request time server variable. | |
SalesforceMapping:: |
public | function |
Get the Salesforce Object type name for this mapping, e.g. "Contact". Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Return TRUE if an upsert key is set for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase:: |
|
SalesforceMapping:: |
public | function |
Save the entity. Overrides ConfigEntityBase:: |
|
SalesforceMapping:: |
public | function |
Set this mapping as having been last processed for deletes at $time. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Set this mapping as having been last pulled at $time. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
public | function |
Set the timestamp when the push queue was last process for this mapping. Overrides SalesforceMappingInterface:: |
|
SalesforceMapping:: |
protected | function | Setter for pull info. | |
SalesforceMapping:: |
protected | function | Setter for pull info. | |
SalesforceMapping:: |
protected | function | State service. | |
SalesforceMapping:: |
public | function |
Constructs an Entity object. Overrides ConfigEntityBase:: |
|
SalesforceMapping:: |
public | function |
Magic getter method for mapping properties. Overrides SalesforceMappingInterface:: |
|
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function |