You are here

class PullQueueItem in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_pull/src/PullQueueItem.php \Drupal\salesforce_pull\PullQueueItem
  2. 5.0.x modules/salesforce_pull/src/PullQueueItem.php \Drupal\salesforce_pull\PullQueueItem

A salesforce_pull_queue item.

Hierarchy

Expanded class hierarchy of PullQueueItem

2 files declare their use of PullQueueItem
PullBaseTest.php in modules/salesforce_pull/tests/src/Unit/PullBaseTest.php
PullQueueItemTest.php in modules/salesforce_pull/tests/src/Unit/PullQueueItemTest.php

File

modules/salesforce_pull/src/PullQueueItem.php, line 11

Namespace

Drupal\salesforce_pull
View source
class PullQueueItem {

  /**
   * The salesforce object data.
   *
   * @var \Drupal\salesforce\SObject
   */
  protected $sobject;

  /**
   * The mapping id corresponding to this pull.
   *
   * @var string
   */
  protected $mappingId;

  /**
   * Whether to force pull for the given record.
   *
   * @var bool
   */
  protected $forcePull;

  /**
   * Construct a pull queue item.
   *
   * @param \Drupal\salesforce\SObject $sobject
   *   Salesforce data.
   * @param \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping
   *   Mapping.
   * @param bool $force_pull
   *   Force data to be pulled, ignoring any timestamps.
   */
  public function __construct(SObject $sobject, SalesforceMappingInterface $mapping, $force_pull = FALSE) {
    $this->sobject = $sobject;
    $this->mappingId = $mapping->id;
    $this->forcePull = $force_pull;
  }

  /**
   * Getter.
   *
   * @return \Drupal\salesforce\SObject
   *   Salesforce data.
   */
  public function getSobject() {
    return $this->sobject;
  }

  /**
   * Getter.
   *
   * @return string
   *   Salesforce mapping id.
   */
  public function getMappingId() {

    // Legacy backwards compatibility.
    // @TODO remove for 8.x-3.3
    if (property_exists($this, 'mapping_id')) {
      return $this->mapping_id;
    }
    return $this->mappingId;
  }

  /**
   * Getter.
   *
   * @return bool
   *   Force pull.
   */
  public function getForcePull() {

    // Legacy backwards compatibility.
    // @TODO remove for 8.x-3.3
    if (property_exists($this, 'force_pull')) {
      return $this->force_pull;
    }
    return $this->forcePull;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PullQueueItem::$forcePull protected property Whether to force pull for the given record.
PullQueueItem::$mappingId protected property The mapping id corresponding to this pull.
PullQueueItem::$sobject protected property The salesforce object data.
PullQueueItem::getForcePull public function Getter.
PullQueueItem::getMappingId public function Getter.
PullQueueItem::getSobject public function Getter.
PullQueueItem::__construct public function Construct a pull queue item.