private function MappedObjectForm::getDrupalEntityFromUrl in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping_ui/src/Form/MappedObjectForm.php \Drupal\salesforce_mapping_ui\Form\MappedObjectForm::getDrupalEntityFromUrl()
Helper to fetch the contextual Drupal entity.
1 call to MappedObjectForm::getDrupalEntityFromUrl()
- MappedObjectForm::buildForm in modules/
salesforce_mapping_ui/ src/ Form/ MappedObjectForm.php - Form constructor.
File
- modules/
salesforce_mapping_ui/ src/ Form/ MappedObjectForm.php, line 265
Class
- MappedObjectForm
- Salesforce Mapping Form base.
Namespace
Drupal\salesforce_mapping_ui\FormCode
private function getDrupalEntityFromUrl() {
// Fetch the current entity from context.
// @TODO what if there's more than one entity in route params?
$entity_type_id = $this->request->query
->get('entity_type_id');
$entity_id = $this->request->query
->get('entity_id');
if (empty($entity_id) || empty($entity_type_id)) {
return FALSE;
}
return $this->entityTypeManager
->getStorage($entity_type_id)
->load($entity_id);
}