You are here

interface SalesforceMappingInterface in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Entity/SalesforceMappingInterface.php \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface
  2. 8.3 modules/salesforce_mapping/src/Entity/SalesforceMappingInterface.php \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface

Mapping between Drupal and Salesforce records.

Hierarchy

Expanded class hierarchy of SalesforceMappingInterface

All classes that implement SalesforceMappingInterface

32 files declare their use of SalesforceMappingInterface
Broken.php in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Broken.php
Constant.php in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Constant.php
DeleteHandlerTest.php in modules/salesforce_pull/tests/src/Unit/DeleteHandlerTest.php
DrupalConstant.php in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/DrupalConstant.php
Hardcoded.php in modules/salesforce_example/src/Plugin/SalesforceMappingField/Hardcoded.php

... See full list

File

modules/salesforce_mapping/src/Entity/SalesforceMappingInterface.php, line 12

Namespace

Drupal\salesforce_mapping\Entity
View source
interface SalesforceMappingInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface {

  /**
   * Magic getter method for mapping properties.
   *
   * @param string $key
   *   The property to get.
   *
   * @return mixed
   *   The value.
   */
  public function __get($key);

  /**
   * Get all the mapped field plugins for this mapping.
   *
   * @return \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface[]
   *   The fields.
   */
  public function getFieldMappings();

  /**
   * Given a field config, create an instance of a field mapping.
   *
   * @param array $field
   *   Field plugin definition. Keys are "drupal_field_type" and "config".
   *
   * @return \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface
   *   The field.
   */
  public function getFieldMapping(array $field);

  /**
   * Get the Salesforce Object type name for this mapping, e.g. "Contact".
   *
   * @return string
   *   The object name.
   */
  public function getSalesforceObjectType();

  /**
   * Get the Drupal entity type name for this mapping, e.g. "node".
   *
   * @return string
   *   The entity type id.
   */
  public function getDrupalEntityType();

  /**
   * Get the Drupal bundle name for this mapping, e.g. "article".
   *
   * @return string
   *   The bundle.
   */
  public function getDrupalBundle();

  /**
   * Get all the field plugins which are configured to pull from Salesforce.
   *
   * @return \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface[]
   *   Array of objects.
   */
  public function getPullFields();

  /**
   * Get a flat array of the field plugins which are configured to pull.
   *
   * @return array
   *   Keys and values are Salesforce field names.
   */
  public function getPullFieldsArray();

  /**
   * The Salesforce date field which determines whether to pull.
   *
   * @return string
   *   SF field name.
   */
  public function getPullTriggerDate();

  /**
   * Getter for push_standalone property.
   *
   * @return bool
   *   TRUE if this mapping is set to process push queue via a standalone
   *   endpoint instead of during cron.
   */
  public function doesPushStandalone();

  /**
   * Getter for push_standalone property.
   *
   * @return bool
   *   TRUE if this mapping is set to process push queue via a standalone
   *   endpoint instead of during cron.
   */
  public function doesPullStandalone();

  /**
   * Checks mappings for any push operation.
   *
   * @return bool
   *   TRUE if this mapping is configured to push.
   */
  public function doesPush();

  /**
   * Checks mappings for any pull operation.
   *
   * @return bool
   *   TRUE if this mapping is configured to pull.
   */
  public function doesPull();

  /**
   * Checks if mapping has any of the given triggers.
   *
   * @param array $triggers
   *   Collection of SALESFORCE_MAPPING_SYNC_* constants from MappingConstants.
   *
   * @see \Drupal\salesforce_mapping\MappingConstants
   *
   * @return bool
   *   TRUE if any of the given $triggers are enabled for this mapping.
   */
  public function checkTriggers(array $triggers);

  /**
   * Return TRUE if an upsert key is set for this mapping.
   *
   * @return bool
   *   Return TRUE if an upsert key is set for this mapping.
   */
  public function hasKey();

  /**
   * Return name of the Salesforce field which is the upsert key.
   *
   * @return string
   *   The upsert key Salesforce field name.
   */
  public function getKeyField();

  /**
   * Given a Drupal entity, get the value to be upserted.
   *
   * @return mixed
   *   The upsert field value.
   */
  public function getKeyValue(EntityInterface $entity);

  /**
   * Return the timestamp for the date of most recent delete processing.
   *
   * @return int|null
   *   Integer timestamp of last delete, or NULL if delete has not been run.
   */
  public function getLastDeleteTime();

  /**
   * Set this mapping as having been last processed for deletes at $time.
   *
   * @param int $time
   *   The delete time to set.
   *
   * @return $this
   */
  public function setLastDeleteTime($time);

  /**
   * Return the timestamp for the date of most recent pull processing.
   *
   * @return mixed
   *   Integer timestamp of last pull, or NULL if pull has not been run.
   */
  public function getLastPullTime();

  /**
   * Set this mapping as having been last pulled at $time.
   *
   * @param int $time
   *   The pull time to set.
   *
   * @return $this
   */
  public function setLastPullTime($time);

  /**
   * Get the timestamp when the next pull should be processed for this mapping.
   *
   * @return int
   *   The next pull time.
   */
  public function getNextPullTime();

  /**
   * Generate a select query to pull records from Salesforce for this mapping.
   *
   * @param array $mapped_fields
   *   Fetch only these fields, if given, otherwise fetch all mapped fields.
   * @param int $start
   *   Timestamp of starting window from which to pull records. If omitted, use
   *   ::getLastPullTime()
   * @param int $stop
   *   Timestamp of ending window from which to pull records. If omitted, use
   *   "now".
   *
   * @return \Drupal\salesforce\SelectQuery
   *   The pull query.
   */
  public function getPullQuery(array $mapped_fields = [], $start = 0, $stop = 0);

  /**
   * Returns a timstamp when the push queue was last processed for this mapping.
   *
   * @return int|null
   *   The last push time, or NULL.
   */
  public function getLastPushTime();

  /**
   * Set the timestamp when the push queue was last process for this mapping.
   *
   * @param string $time
   *   The push time to set.
   *
   * @return $this
   */
  public function setLastPushTime($time);

  /**
   * Get the timestamp when the next push should be processed for this mapping.
   *
   * @return int
   *   The next push time.
   */
  public function getNextPushTime();

  /**
   * Return TRUE if this mapping should always use upsert over create or update.
   *
   * @return bool
   *   Whether to upsert, ignoring any local Salesforce ID.
   */
  public function alwaysUpsert();

}

Members

Namesort descending Modifiers Type Description Overrides
AccessibleInterface::access public function Checks data value access. 9
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
ConfigEntityInterface::calculateDependencies public function Calculates dependencies and stores them in the dependency property. 2
ConfigEntityInterface::disable public function Disables the configuration entity. 2
ConfigEntityInterface::enable public function Enables the configuration entity. 2
ConfigEntityInterface::get public function Returns the value of a property. 2
ConfigEntityInterface::getDependencies public function Gets the configuration dependencies. 2
ConfigEntityInterface::hasTrustedData public function Gets whether on not the data is trusted. 2
ConfigEntityInterface::isInstallable public function Checks whether this entity is installable. 2
ConfigEntityInterface::isUninstalling public function Returns whether this entity is being changed during the uninstall process. 2
ConfigEntityInterface::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. 2
ConfigEntityInterface::set public function Sets the value of a property. 2
ConfigEntityInterface::setStatus public function Sets the status of the configuration entity. 2
ConfigEntityInterface::status public function Returns whether the configuration entity is enabled. 2
ConfigEntityInterface::trustData public function Sets that the data should be trusted. 2
EntityInterface::bundle public function Gets the bundle of the entity. 2
EntityInterface::create public static function Constructs a new entity object, without permanently saving it. 2
EntityInterface::createDuplicate public function Creates a duplicate of the entity. 2
EntityInterface::delete public function Deletes an entity permanently. 2
EntityInterface::enforceIsNew public function Enforces an entity to be new. 2
EntityInterface::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. 2
EntityInterface::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. 2
EntityInterface::getConfigDependencyName public function Gets the configuration dependency name. 2
EntityInterface::getConfigTarget public function Gets the configuration target identifier for the entity. 2
EntityInterface::getEntityType public function Gets the entity type definition. 2
EntityInterface::getEntityTypeId public function Gets the ID of the type of the entity. 2
EntityInterface::getOriginalId public function Gets the original ID. 2
EntityInterface::getTypedData public function Gets a typed data object for this entity object. 2
EntityInterface::hasLinkTemplate public function Indicates if a link template exists for a given key. 2
EntityInterface::id public function Gets the identifier. 2
EntityInterface::isNew public function Determines whether the entity is new. 2
EntityInterface::label public function Gets the label of the entity. 2
EntityInterface::language public function Gets the language of the entity. 2
EntityInterface::load public static function Loads an entity. 2
EntityInterface::loadMultiple public static function Loads one or more entities. 2
EntityInterface::postCreate public function Acts on a created entity before hooks are invoked. 2
EntityInterface::postDelete public static function Acts on deleted entities before the delete hook is invoked. 2
EntityInterface::postLoad public static function Acts on loaded entities. 3
EntityInterface::postSave public function Acts on a saved entity before the insert or update hook is invoked. 2
EntityInterface::preCreate public static function Changes the values of an entity before it is created. 2
EntityInterface::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. 2
EntityInterface::preSave public function Acts on an entity before the presave hook is invoked. 2
EntityInterface::referencedEntities public function Gets a list of entities referenced by this entity. 2
EntityInterface::save public function Saves an entity permanently. 2
EntityInterface::setOriginalId public function Sets the original ID. 2
EntityInterface::toArray public function Gets an array of all property values. 3
EntityInterface::toLink public function Generates the HTML for a link to this entity. 2
EntityInterface::toUrl public function Gets the URL object for the entity. 2
EntityInterface::uriRelationships public function Gets a list of URI relationships supported by this entity. 2
EntityInterface::uuid public function Gets the entity UUID (Universally Unique Identifier). 2
ObjectWithPluginCollectionInterface::getPluginCollections public function Gets the plugin collections used by this object. 11
RefinableCacheableDependencyInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. 1
RefinableCacheableDependencyInterface::addCacheContexts public function Adds cache contexts. 1
RefinableCacheableDependencyInterface::addCacheTags public function Adds cache tags. 1
RefinableCacheableDependencyInterface::mergeCacheMaxAge public function Merges the maximum age (in seconds) with the existing maximum age. 1
SalesforceMappingInterface::alwaysUpsert public function Return TRUE if this mapping should always use upsert over create or update. 1
SalesforceMappingInterface::checkTriggers public function Checks if mapping has any of the given triggers. 1
SalesforceMappingInterface::doesPull public function Checks mappings for any pull operation. 1
SalesforceMappingInterface::doesPullStandalone public function Getter for push_standalone property. 1
SalesforceMappingInterface::doesPush public function Checks mappings for any push operation. 1
SalesforceMappingInterface::doesPushStandalone public function Getter for push_standalone property. 1
SalesforceMappingInterface::getDrupalBundle public function Get the Drupal bundle name for this mapping, e.g. "article". 1
SalesforceMappingInterface::getDrupalEntityType public function Get the Drupal entity type name for this mapping, e.g. "node". 1
SalesforceMappingInterface::getFieldMapping public function Given a field config, create an instance of a field mapping. 1
SalesforceMappingInterface::getFieldMappings public function Get all the mapped field plugins for this mapping. 1
SalesforceMappingInterface::getKeyField public function Return name of the Salesforce field which is the upsert key. 1
SalesforceMappingInterface::getKeyValue public function Given a Drupal entity, get the value to be upserted. 1
SalesforceMappingInterface::getLastDeleteTime public function Return the timestamp for the date of most recent delete processing. 1
SalesforceMappingInterface::getLastPullTime public function Return the timestamp for the date of most recent pull processing. 1
SalesforceMappingInterface::getLastPushTime public function Returns a timstamp when the push queue was last processed for this mapping. 1
SalesforceMappingInterface::getNextPullTime public function Get the timestamp when the next pull should be processed for this mapping. 1
SalesforceMappingInterface::getNextPushTime public function Get the timestamp when the next push should be processed for this mapping. 1
SalesforceMappingInterface::getPullFields public function Get all the field plugins which are configured to pull from Salesforce. 1
SalesforceMappingInterface::getPullFieldsArray public function Get a flat array of the field plugins which are configured to pull. 1
SalesforceMappingInterface::getPullQuery public function Generate a select query to pull records from Salesforce for this mapping. 1
SalesforceMappingInterface::getPullTriggerDate public function The Salesforce date field which determines whether to pull. 1
SalesforceMappingInterface::getSalesforceObjectType public function Get the Salesforce Object type name for this mapping, e.g. "Contact". 1
SalesforceMappingInterface::hasKey public function Return TRUE if an upsert key is set for this mapping. 1
SalesforceMappingInterface::setLastDeleteTime public function Set this mapping as having been last processed for deletes at $time. 1
SalesforceMappingInterface::setLastPullTime public function Set this mapping as having been last pulled at $time. 1
SalesforceMappingInterface::setLastPushTime public function Set the timestamp when the push queue was last process for this mapping. 1
SalesforceMappingInterface::__get public function Magic getter method for mapping properties. 1
SynchronizableInterface::isSyncing public function Returns whether this entity is being changed as part of a synchronization. 1
SynchronizableInterface::setSyncing public function Sets the status of the synchronization flag. 1
ThirdPartySettingsInterface::getThirdPartyProviders public function Gets the list of third parties that store information. 5
ThirdPartySettingsInterface::getThirdPartySetting public function Gets the value of a third-party setting. 5
ThirdPartySettingsInterface::getThirdPartySettings public function Gets all third-party settings of a given module. 5
ThirdPartySettingsInterface::setThirdPartySetting public function Sets the value of a third-party setting. 5
ThirdPartySettingsInterface::unsetThirdPartySetting public function Unsets a third-party setting. 5