Add getName method to NameValue class
This commit is contained in:
parent
92715265b3
commit
ec68b7a787
1 changed files with 10 additions and 2 deletions
|
|
@ -9,11 +9,19 @@ class NameValue
|
||||||
return static::COLLECTION;
|
return static::COLLECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function validate($type_text)
|
static public function validate($value)
|
||||||
{
|
{
|
||||||
if (isset(static::COLLECTION[$type_text]))
|
if (isset(static::COLLECTION[$value]))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function getName($value)
|
||||||
|
{
|
||||||
|
if (isset(static::COLLECTION[$value]))
|
||||||
|
return static::COLLECTION[$value];
|
||||||
|
|
||||||
|
return 'Unknown';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue