承接 tuscanicz/doctrine-enum-oracle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-09