src/ORM/FieldType/DBEnum.php
public function getEnumObsolete()
    {
        // Without a table or field specified, we can only retrieve known enum values
        $table = $this->getTable();
        $name = $this->getName();
        if (empty($table) || empty($name)) {
            return $this->getEnum();
        }

        // Ensure the table level cache exists
        if (empty(self::$enum_cache[$table])) {
            self::$enum_cache[$table] = array();
        }

        // Check existing cache
        if (!empty(self::$enum_cache[$table][$name])) {
            return self::$enum_cache[$table][$name];
        }

        // Get all enum values
        $enumValues = $this->getEnum();
        if (DB::get_schema()->hasField($table, $name)) {
            $existing = DB::query("SELECT DISTINCT \"{$name}\" FROM \"{$table}\"")->column();
            $enumValues = array_unique(array_merge($enumValues, $existing));
        }

        // Cache and return
        self::$enum_cache[$table][$name] = $enumValues;
        return $enumValues;
    }
public function getEnumObsolete()
    {
        // Without a table or field specified, we can only retrieve known enum values
        $table = $this->getTable();
        $name = $this->getName();
        if (empty($table) || empty($name)) {
            return $this->getEnum();
        }

        // Ensure the table level cache exists
        if (empty(self::$enum_cache[$table])) {
            self::$enum_cache[$table] = array();
        }

        // Check existing cache
        if (!empty(self::$enum_cache[$table][$name])) {
            return self::$enum_cache[$table][$name];
        }

        // Get all enum values
        $enumValues = $this->getEnum();
        if (DB::get_schema()->hasField($table, $name)) {
            $existing = DB::query("SELECT DISTINCT \"{$name}\" FROM \"{$table}\"")->column();
            $enumValues = array_unique(array_merge($enumValues, $existing));
        }

        // Cache and return
        self::$enum_cache[$table][$name] = $enumValues;
        return $enumValues;
    }
public function getEnumObsolete ( ) { // Without a table or field specified, we can only retrieve known enum values $ table = $ this -> getTable ( ) ; $ name = $ this -> getName ( ) ; if ( empty ( $ table ) || empty ( $ name ) ) { return $ this -> getEnum ( ) ; } // Ensure the table level cache exists if ( empty ( self :: $ enum_cache [ $ table ] ) ) { self :: $ enum_cache [ $ table ] = array ( ) ; } // Check existing cache if ( ! empty ( self :: $ enum_cache [ $ table ] [ $ name ] ) ) { return self :: $ enum_cache [ $ table ] [ $ name ] ; } // Get all enum values $ enumValues = $ this -> getEnum ( ) ; if ( DB :: get_schema ( ) -> hasField ( $ table , $ name ) ) { $ existing = DB :: query ( "SELECT DISTINCT \"{$name}\" FROM \"{$table}\"" ) -> column ( ) ; $ enumValues = array_unique ( array_merge ( $ enumValues , $ existing ) ) ; } // Cache and return self :: $ enum_cache [ $ table ] [ $ name ] = $ enumValues ; return $ enumValues ; }
Get the list of enum values, including obsolete values still present in the database

If table or name are not set, or if it is not a valid field on the given table,
then only known enum values are returned.

Values cached in this method can be cleared via `DBEnum::flushCache();`

@return array
Get the list of enum values including obsolete values still present in the database