You are here

public function MappedObjectStorage::loadByEntity in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/MappedObjectStorage.php \Drupal\salesforce_mapping\MappedObjectStorage::loadByEntity()
  2. 8.3 modules/salesforce_mapping/src/MappedObjectStorage.php \Drupal\salesforce_mapping\MappedObjectStorage::loadByEntity()

Load MappedObjects by Drupal Entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: Drupal entity.

Return value

\Drupal\salesforce_mapping\Entity\MappedObject[] Mapped objects.

See also

loadByProperties()

File

modules/salesforce_mapping/src/MappedObjectStorage.php, line 50

Class

MappedObjectStorage
Class MappedObjectStorage.

Namespace

Drupal\salesforce_mapping

Code

public function loadByEntity(EntityInterface $entity) {
  return $this
    ->loadByProperties([
    'drupal_entity__target_type' => $entity
      ->getEntityTypeId(),
    'drupal_entity__target_id' => $entity
      ->id(),
  ]);
}