1
0
mirror of synced 2024-12-13 22:56:04 +03:00

fixing getEnumValues()

This commit is contained in:
pookey 2007-01-29 14:44:27 +00:00
parent b7cac8cb4e
commit 9a45b64391

View File

@ -1171,8 +1171,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*/
final public function getEnumValues($field)
{
if (isset($this->options['enumMap'][$field])) {
return $this->options['enumMap'][$field];
if (isset($this->columns[$field][2]['values'])) {
return $this->columns[$field][2]['values'];
} else {
return array();
}
@ -1200,11 +1200,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*/
public function enumIndex($field, $value)
{
if ( ! isset($this->columns[$field][2]['values'])) {
$values = array();
} else {
$values = $this->columns[$field][2]['values'];
}
$values = $this->getEnumValues($field);
return array_search($value, $values);
}