Início / Optitravel / Helpers / ScimHelper
translateAttribute(string $attribute): string
This method maps external SCIM attribute names to the internal column names used by the application. It is commonly used during query parsing to ensure that only valid, database-recognized columns are used in filters and sorting.
If no specific mapping exists, the original attribute is returned as-is
Parameters
- $attribute – (string) Required. The SCIM attribute name to be translated (e.g., userName, emails, active).
Returns
- (string) Returns the corresponding internal column name used in the application. If the attribute is not recognized, it returns the input attribute unchanged.
Example
use \App\Utils\ScimHelper;
$translated = ScimHelper::translateAttribute('userName');
Output:
'username'
Mapped Attributes
| SCIM Attribute | Internal Column |
|---|---|
| userName | username |
| emails | |
| preferredLanguage | lang |
| active | status |
| familyName | name |
| givenName | name |
| created | create_time |
| lastModified | last_change_time |
| displayName | template |
↑ (Última atualização: 14/05/2025)