1
0
mirror of synced 2025-01-06 00:57:10 +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) final public function getEnumValues($field)
{ {
if (isset($this->options['enumMap'][$field])) { if (isset($this->columns[$field][2]['values'])) {
return $this->options['enumMap'][$field]; return $this->columns[$field][2]['values'];
} else { } else {
return array(); return array();
} }
@ -1200,11 +1200,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*/ */
public function enumIndex($field, $value) public function enumIndex($field, $value)
{ {
if ( ! isset($this->columns[$field][2]['values'])) { $values = $this->getEnumValues($field);
$values = array();
} else {
$values = $this->columns[$field][2]['values'];
}
return array_search($value, $values); return array_search($value, $values);
} }