public function enum($model, $key = null, $value = null) {
        $alias = is_string($model) ? $model : $model->alias;

        if (!isset($this->_enums[$alias])) {
            throw new InvalidArgumentException(sprintf('%s::$enum does not exist', $alias));
        }

        $enum = $this->_enums[$alias];

        if ($key) {
            if (!isset($enum[$key])) {
                throw new OutOfBoundsException(sprintf('Field %s does not exist within %s::$enum', $key, $model->alias));
            }

            if ($value !== null) {
                return isset($enum[$key][$value]) ? $enum[$key][$value] : null;
            } else {
                return $enum[$key];
            }
        }

        return $enum;
    }