Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
ParamOverriderInterface Interface Reference
Inheritance diagram for ParamOverriderInterface:
ParamOverriderCartId ParamOverriderCustomerId

Public Member Functions

 getOverriddenValue ()
 

Detailed Description

Override parameter values

Parameters in the webapi.xml can be forced. This ensures that on specific routes, a specific value is always used. For instance, if there is a ".../me/..." route, the route should use only user information specific to the currently logged in user. More specifically, if there was a "/customers/me/addresses" route, the service method invoked could have a signature of "getAddresses($customerId)", but in the webapi.xml, the $customerId parameter would be forced to be the customer id of the current authenticated user.

The forced override parameter configuration is in the webapi.xml.

<data> <parameter name="customer.id" force="true">customer_id%</parameter> </data>

Classes which implement ParamOverriderInterface would return the real value for the parameter, so a ParamOverriderCustomerId would return the current authenticated user's customer id. If you create new ParamOverriderInterface implementations, you can register new implementations by adding to the parameter list for ParamsOverrider's dependency injection configuration.

@api

Since
100.0.2

Definition at line 32 of file ParamOverriderInterface.php.

Member Function Documentation

◆ getOverriddenValue()

getOverriddenValue ( )

Returns the overridden value to use.

Returns
string|int|null
Exceptions

Implemented in ParamOverriderCustomerId.


The documentation for this interface was generated from the following file: