Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.42 KB

additional_methods.md

File metadata and controls

44 lines (32 loc) · 1.42 KB

Additional methods

AbstractEnumType provides few additional methods, which might be useful.

If you need to check if some string value exists in the array of ENUM values:
BasketballPositionType::isValueExist('Pitcher');
// Will return: false
If you need to get value in the readable format:
BasketballPositionType::getReadableValue(BasketballPositionType::SHOOTING_GUARD);
// Will return: Shooting Guard
If you need to get all values:
BasketballPositionType::getValues();
// Will return: ['PG', 'SG', 'SF', 'PF', 'C']
If you need to return a random value:
BasketballPositionType::getRandomValue();
// Will randomly return one of the available values: 'PG', 'SG', 'SF', 'PF', 'C'

More features