You are here

function salesforce_mapping_menu_local_actions_alter in Salesforce Suite 8.3

Implements hook_local_actions_alter().

File

modules/salesforce_mapping/salesforce_mapping.module, line 30
Manages Salesforce object and Drupal entity mappings.

Code

function salesforce_mapping_menu_local_actions_alter(&$local_actions) {
  foreach (\Drupal::entityManager()
    ->getDefinitions() as $entity_type_id => $entity_type) {
    if (\Drupal::entityTypeManager()
      ->getStorage('salesforce_mapping')
      ->loadByDrupal($entity_type_id)) {
      $local_actions['salesforce_mapped_object.add_action']['appears_on'][] = "entity.{$entity_type_id}.salesforce";
    }
  }
}