function ingredient_unit_fuzzymatch in Recipe 8.2
Returns a best-guess matched unit key for a unit of measure.
Parameters
string $subject: The unit of measure for which the function will search.
Return value
string|false The unit's key from configuration or FALSE if there was no match.
Deprecated
This function was deprecated in version 8.x-2.0 and will be removed in version 3.0.0. Use \Drupal\ingredient\Utility\IngredientUnitFuzzymatch::getUnitFuzzymatch() instead.
File
- modules/
ingredient/ ingredient.module, line 137 - Contains basic functions for the Ingredient module.
Code
function ingredient_unit_fuzzymatch($subject) {
return \Drupal::service('ingredient.fuzzymatch')
->getUnitFuzzymatch($subject);
}