clevis/utils-enum-constants

Utility to get values of constants of given prefix.

dev-master 2013-08-26 20:44 UTC

This package is not auto-updated.

Last update: 2024-11-19 02:21:37 UTC


README

Utility to get values of constants of given prefix.

Example usage:

class Foo
{
	const PREFIX_FOO = 'foo';
	const PREFIX_BAR = 'bar';
	const SOME_UNRELATED_CONSTANT = 'whatever';
}

var_export(Clevis\Utils\EnumConstants::getEnumValues('Foo', 'PREFIX_'));

Prints out:

array(
	'foo' => 'foo',
	'bar' => 'bar'
)