$data['role'
] =
$role;
} else { unset($data['role'
]);
} // Check if a locale id or name is passed.
if (!
empty($data['localeId'
])) { if (!
$this->
isLocaleId((int) $data['localeId'
])) { throw new ApiException\
CustomValidationException(sprintf('Locale by id %s not found',
$data['localeId'
]));
} } elseif (!
empty($data['locale'
])) { $localeId =
$this->
getLocaleIdFromLocale($data['locale'
]);
if (!
$localeId) { throw new ApiException\
CustomValidationException(sprintf('Locale by name %s not found',
$data['locale'
]));
} $data['localeId'
] =
$localeId;
} else { unset($data['locale'
]);
} if (!
empty($data['attribute'
])) { foreach ($data['attribute'
] as $key =>
$value) { if (is_numeric($key)) {