public function MappedObjectController::listing in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping_ui/src/Controller/MappedObjectController.php \Drupal\salesforce_mapping_ui\Controller\MappedObjectController::listing()
List mapped objects for the entity along the current route.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: A RouteMatch object.
Return value
array Array of page elements to render.
Throws
\Exception
File
- modules/
salesforce_mapping_ui/ src/ Controller/ MappedObjectController.php, line 100
Class
- MappedObjectController
- Returns responses for devel module routes.
Namespace
Drupal\salesforce_mapping_ui\ControllerCode
public function listing(RouteMatchInterface $route_match) {
$entity = $this
->getEntity($route_match);
$salesforce_mapped_objects = $this
->getMappedObjects($entity);
if (empty($salesforce_mapped_objects)) {
return [
'#markup' => $this
->t('No mapped objects for %label.', [
'%label' => $entity
->label(),
]),
];
}
// Show the entity view for the mapped object.
$builder = $this
->entityTypeManager()
->getListBuilder('salesforce_mapped_object');
return $builder
->setEntityIds(array_keys($salesforce_mapped_objects))
->render();
}