class SalesforceMappedObjectAddLocalAction in Salesforce Suite 8.4
Same name and namespace in other branches
- 5.0.x modules/salesforce_mapping_ui/src/Plugin/Menu/LocalAction/SalesforceMappedObjectAddLocalAction.php \Drupal\salesforce_mapping_ui\Plugin\Menu\LocalAction\SalesforceMappedObjectAddLocalAction
Local action for salesforce mapped objects.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Menu\LocalActionDefault implements CacheableDependencyInterface, LocalActionInterface, ContainerFactoryPluginInterface uses DependencySerializationTrait
- class \Drupal\salesforce_mapping_ui\Plugin\Menu\LocalAction\SalesforceMappedObjectAddLocalAction
- class \Drupal\Core\Menu\LocalActionDefault implements CacheableDependencyInterface, LocalActionInterface, ContainerFactoryPluginInterface uses DependencySerializationTrait
Expanded class hierarchy of SalesforceMappedObjectAddLocalAction
1 string reference to 'SalesforceMappedObjectAddLocalAction'
- salesforce_mapping_ui.links.action.yml in modules/
salesforce_mapping_ui/ salesforce_mapping_ui.links.action.yml - modules/salesforce_mapping_ui/salesforce_mapping_ui.links.action.yml
File
- modules/
salesforce_mapping_ui/ src/ Plugin/ Menu/ LocalAction/ SalesforceMappedObjectAddLocalAction.php, line 13
Namespace
Drupal\salesforce_mapping_ui\Plugin\Menu\LocalActionView source
class SalesforceMappedObjectAddLocalAction extends LocalActionDefault {
/**
* {@inheritdoc}
*/
public function getTitle(Request $request = NULL) {
// @TODO unclear how to translate this, but needs to be translated:
return 'Create Mapped Object';
}
/**
* {@inheritdoc}
*/
public function getOptions(RouteMatchInterface $route_match) {
// If our local action is appearing contextually on an entity, provide
// contextual entity paramaters to the add form link.
$options = parent::getOptions($route_match);
$entity_type_id = $route_match
->getRouteObject()
->getOption('_salesforce_entity_type_id');
if (empty($entity_type_id)) {
return $options;
}
$entity = $route_match
->getParameter($entity_type_id);
if (!$entity || !$entity instanceof EntityInterface) {
return $options;
}
$options['query'] = [
'entity_type_id' => $entity_type_id,
'entity_id' => $entity
->id(),
];
return $options;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
LocalActionDefault:: |
protected | property | The route provider to load routes by name. | |
LocalActionDefault:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
2 |
LocalActionDefault:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
LocalActionDefault:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
LocalActionDefault:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
LocalActionDefault:: |
public | function |
Get the route name from the settings. Overrides LocalActionInterface:: |
|
LocalActionDefault:: |
public | function |
Returns the route parameters needed to render a link for the local action. Overrides LocalActionInterface:: |
|
LocalActionDefault:: |
public | function |
Returns the weight for the local action. Overrides LocalActionInterface:: |
|
LocalActionDefault:: |
public | function |
Constructs a LocalActionDefault object. Overrides PluginBase:: |
2 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
SalesforceMappedObjectAddLocalAction:: |
public | function |
Returns options for rendering a link for the local action. Overrides LocalActionDefault:: |
|
SalesforceMappedObjectAddLocalAction:: |
public | function |
Returns the localized title to be shown for this action. Overrides LocalActionDefault:: |