Zend_Db 枚举值

发布于 2024-08-28 03:36:36 字数 2019 浏览 7 评论 0原文

我找到了这个解决方案

$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];

嗨, 我想获取 Zend_Db 中的枚举值。 我的代码:

$select = $this->select();
$result = $select->fetchAll();
print_r($result->getTable());

输出:

Example Object
(
    [_name] => country
    [query] => Zend_Db_Table_Select Object
        (
            [_info:protected] => Array
                (
                    [schema] => 
                    [name] => country
                    [cols] => Array
                        (
                            [0] => Code
                            [1] => Continent

                        )

                    [primary] => Array
                        (
                            [1] => Code
                        )

                    [metadata] => Array
                        (
                            [Continent] => Array
                                (
                                    [SCHEMA_NAME] => 
                                    [TABLE_NAME] => country
                                    [COLUMN_NAME] => Continent
                                    [COLUMN_POSITION] => 3
                                    [DATA_TYPE] => enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America')
                                    [DEFAULT] => Asia
                                    [NULLABLE] => 
                                    [LENGTH] => 
                                    [SCALE] => 
                                    [PRECISION] => 
                                    [UNSIGNED] => 
                                    [PRIMARY] => 
                                    [PRIMARY_POSITION] => 
                                    [IDENTITY] => 
                                )

我在 data_type 中看到枚举值,但没有得到这个值。如何获取data_type?

I find this solution

$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];

Hi,
I want to get enum values in Zend_Db.
My Code:

$select = $this->select();
$result = $select->fetchAll();
print_r($result->getTable());

Output:

Example Object
(
    [_name] => country
    [query] => Zend_Db_Table_Select Object
        (
            [_info:protected] => Array
                (
                    [schema] => 
                    [name] => country
                    [cols] => Array
                        (
                            [0] => Code
                            [1] => Continent

                        )

                    [primary] => Array
                        (
                            [1] => Code
                        )

                    [metadata] => Array
                        (
                            [Continent] => Array
                                (
                                    [SCHEMA_NAME] => 
                                    [TABLE_NAME] => country
                                    [COLUMN_NAME] => Continent
                                    [COLUMN_POSITION] => 3
                                    [DATA_TYPE] => enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America')
                                    [DEFAULT] => Asia
                                    [NULLABLE] => 
                                    [LENGTH] => 
                                    [SCALE] => 
                                    [PRECISION] => 
                                    [UNSIGNED] => 
                                    [PRIMARY] => 
                                    [PRIMARY_POSITION] => 
                                    [IDENTITY] => 
                                )

I see enum values in data_type but i don't get this values. How can get data_type?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晚风撩人 2024-09-04 03:36:36

我找到这个解决方案

   $metadata = $result->getTable()->info('metadata');
    echo $metadata['Continent']['DATA_TYPE'];

I find this solution

   $metadata = $result->getTable()->info('metadata');
    echo $metadata['Continent']['DATA_TYPE'];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文