tuscanicz/doctrine-enum-oracle
最新稳定版本:1.0.2
Composer 安装命令:
composer require tuscanicz/doctrine-enum-oracle
包简介
Doctrine type for Enum data type in Oracle.
关键字:
README 文档
README
An abstract class defining a new Doctrine type for Enum data type in Oracle.
Has dependency on tuscanicz/enum and Doctrine 2 doctrine/orm.
How to use
Prepare a new Enum using tuscanicz/enum:
<?php namespace MyApp\Enum; use Enum\AbstractEnum; class MyExampleEnum extends AbstractEnum { const MY_EXAMPLE_ENUM_FIRST = 'first'; const MY_EXAMPLE_ENUM_SECOND = 'second'; const MY_EXAMPLE_ENUM_THIRD = 'third'; }
Create a new Type MyExampleType into MyApp\Component\Doctrine\Type namespace and extending the AbstractEnumType:
<?php namespace MyApp\Component\Doctrine\Type; use Doctrine\DBAL\Platforms\AbstractPlatform; use DoctrineEnumOracle\AbstractEnumType; use MyApp\Enum\MyExampleEnum; class MyExampleType extends AbstractEnumType { public function getEnumClassName() { return MyExampleEnum::class; } }
How to use it with Symfony
Configure a new type (config.yml):
doctrine:
dbal:
types:
MyExampleType: 'MyApp\Component\Doctrine\Type\MyExampleType'
How to use it with Zend Framework
Configure a new type (config.php):
'doctrine' => [
'configuration' => [
'orm_default' => [
'types' => [
'my_example_type' => 'MyApp\Component\Doctrine\Type\MyExampleType',
]
...
]
...
]
...
]
That's all!
Now you can try to generate a new migration or schema diff.
统计信息
- 总下载量: 28.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-09