class SalesforceMappableEntityTypes in Salesforce Suite 8.3
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/SalesforceMappableEntityTypes.php \Drupal\salesforce_mapping\SalesforceMappableEntityTypes
- 5.0.x modules/salesforce_mapping/src/SalesforceMappableEntityTypes.php \Drupal\salesforce_mapping\SalesforceMappableEntityTypes
Mappable entity types constructor.
Hierarchy
- class \Drupal\salesforce_mapping\SalesforceMappableEntityTypes implements SalesforceMappableEntityTypesInterface
Expanded class hierarchy of SalesforceMappableEntityTypes
1 string reference to 'SalesforceMappableEntityTypes'
- salesforce_mapping.services.yml in modules/
salesforce_mapping/ salesforce_mapping.services.yml - modules/salesforce_mapping/salesforce_mapping.services.yml
1 service uses SalesforceMappableEntityTypes
- salesforce_mapping.mappable_entity_types in modules/
salesforce_mapping/ salesforce_mapping.services.yml - Drupal\salesforce_mapping\SalesforceMappableEntityTypes
File
- modules/
salesforce_mapping/ src/ SalesforceMappableEntityTypes.php, line 11
Namespace
Drupal\salesforce_mappingView source
class SalesforceMappableEntityTypes implements SalesforceMappableEntityTypesInterface {
/**
* Constructs a new SalesforceMappableEntities object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_manager) {
$this->entityTypeManager = $entity_manager;
}
/**
* {@inheritdoc}
*/
public function getMappableEntityTypes() {
$entity_info = $this->entityTypeManager
->getDefinitions();
$mappable = [];
// We're only concerned with fieldable entities. This is a relatively
// arbitrary restriction, but otherwise there would be an unweildy number
// of entities. Also exclude MappedObjects themselves.
foreach ($entity_info as $entity_type_id => $entity_type) {
if ($this
->isMappable($entity_type)) {
$mappable[$entity_type_id] = $entity_type;
}
}
return $mappable;
}
/**
* {@inheritdoc}
*/
public function isMappable(EntityTypeInterface $entity_type) {
if (in_array('Drupal\\Core\\Entity\\ContentEntityTypeInterface', class_implements($entity_type)) && $entity_type
->id() != 'salesforce_mapped_object') {
return TRUE;
}
return FALSE;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SalesforceMappableEntityTypes:: |
public | function |
Get an array of entity types that are mappable. Overrides SalesforceMappableEntityTypesInterface:: |
|
SalesforceMappableEntityTypes:: |
public | function |
Given an entity type, return true or false to indicate if it's mappable. Overrides SalesforceMappableEntityTypesInterface:: |
|
SalesforceMappableEntityTypes:: |
public | function | Constructs a new SalesforceMappableEntities object. |