Source for file Enum.php
Documentation is available at Enum.php
* Validates a keyword against a list of valid values.
* @warning The case-insensitive compare of this function uses PHP's
* built-in strtolower and ctype_lower functions, which may
* cause problems with international comparisons
* Lookup table of valid values.
* Bool indicating whether or not enumeration is case sensitive.
* @note In general this is always case insensitive.
* @param $valid_values List of valid values
* @param $case_sensitive Bool indicating whether or not case sensitive
$valid_values =
array(), $case_sensitive =
false
public function validate($string, $config, $context) {
// we may want to do full case-insensitive libraries
return $result ?
$string :
false;
* @param $string In form of comma-delimited list of case-insensitive
* valid values. Example: "foo,bar,baz". Prepend "s:" to make
public function make($string) {
if (strlen($string) >
2 &&
$string[0] ==
's' &&
$string[1] ==
':') {
Documentation generated on Thu, 19 Jun 2008 18:49:09 -0400 by phpDocumentor 1.4.2