You are here

class SalesforcePullEntityValueEvent in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Event/SalesforcePullEntityValueEvent.php \Drupal\salesforce_mapping\Event\SalesforcePullEntityValueEvent
  2. 5.0.x modules/salesforce_mapping/src/Event/SalesforcePullEntityValueEvent.php \Drupal\salesforce_mapping\Event\SalesforcePullEntityValueEvent

Pull entity event.

Hierarchy

Expanded class hierarchy of SalesforcePullEntityValueEvent

1 file declares its use of SalesforcePullEntityValueEvent
MappedObject.php in modules/salesforce_mapping/src/Entity/MappedObject.php

File

modules/salesforce_mapping/src/Event/SalesforcePullEntityValueEvent.php, line 12

Namespace

Drupal\salesforce_mapping\Event
View source
class SalesforcePullEntityValueEvent extends SalesforceBaseEvent {

  /**
   * The value of the field to be assigned.
   *
   * @var mixed
   */
  protected $entityValue;

  /**
   * The field plugin responsible for pulling the data.
   *
   * @var \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface
   */
  protected $fieldPlugin;

  /**
   * The mapped object, or mapped object stub.
   *
   * @var \Drupal\salesforce_mapping\Entity\MappedObjectInterface
   */
  protected $mappedObject;

  /**
   * The mapping responsible for this pull.
   *
   * @var \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface
   */
  protected $mapping;

  /**
   * The Drupal entity, or entity stub.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * SalesforcePullEntityValueEvent constructor.
   *
   * @param mixed $value
   *   The value to be assigned.
   * @param \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface $fieldPlugin
   *   The field plugin.
   * @param \Drupal\salesforce_mapping\Entity\MappedObjectInterface $mappedObject
   *   The mapped object.
   */
  public function __construct(&$value, SalesforceMappingFieldPluginInterface $fieldPlugin, MappedObjectInterface $mappedObject) {
    $this->entityValue = $value;
    $this->fieldPlugin = $fieldPlugin;
    $this->mappedObject = $mappedObject;
    $this->entity = $mappedObject
      ->getMappedEntity();
    $this->mapping = $mappedObject
      ->getMapping();
  }

  /**
   * Getter.
   *
   * @return mixed
   *   The value to be pulled and assigned to the Drupal entity.
   */
  public function getEntityValue() {
    return $this->entityValue;
  }

  /**
   * Getter.
   *
   * @return \Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface
   *   The field plugin.
   */
  public function getFieldPlugin() {
    return $this->fieldPlugin;
  }

  /**
   * Getter.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity.
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * Getter.
   *
   * @return \Drupal\salesforce_mapping\Entity\SalesforceMappingInterface
   *   The mapping.
   */
  public function getMapping() {
    return $this->mapping;
  }

  /**
   * Getter.
   *
   * @return \Drupal\salesforce_mapping\Entity\MappedObjectInterface
   *   The mapped object.
   */
  public function getMappedObject() {
    return $this->mappedObject;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SalesforcePullEntityValueEvent::$entity protected property The Drupal entity, or entity stub.
SalesforcePullEntityValueEvent::$entityValue protected property The value of the field to be assigned.
SalesforcePullEntityValueEvent::$fieldPlugin protected property The field plugin responsible for pulling the data.
SalesforcePullEntityValueEvent::$mappedObject protected property The mapped object, or mapped object stub.
SalesforcePullEntityValueEvent::$mapping protected property The mapping responsible for this pull.
SalesforcePullEntityValueEvent::getEntity public function Getter.
SalesforcePullEntityValueEvent::getEntityValue public function Getter.
SalesforcePullEntityValueEvent::getFieldPlugin public function Getter.
SalesforcePullEntityValueEvent::getMappedObject public function Getter.
SalesforcePullEntityValueEvent::getMapping public function Getter.
SalesforcePullEntityValueEvent::__construct public function SalesforcePullEntityValueEvent constructor.