tbbc/doctrine-dbal-pgsql-types

Doctrine 类型或 PostgreSQL 的固定类型。

dev-master / 1.0.x-dev 2014-02-15 14:46 UTC

This package is not auto-updated.

Last update: 2024-09-14 14:55:37 UTC


README

Build Status

这个库为 Doctrine DBAL 添加或覆盖了一些类型。一些类型修复了一些数据库引擎的问题。

快速开始

在 Doctrine DBAL 中注册类型

<?php

use Doctrine\DBAL\Types\Type;

Type::addType('tbbc_pgsql_binary_safe_array', "Tbbc\\Doctrine\\DBAL\\Pgsql\\Types\\BinarySafeArrayType");
Type::addType('tbbc_pgsql_binary_safe_object', "Tbbc\\Doctrine\\DBAL\\Pgsql\\Types\\BinarySafeObjectType");

在 Symfony2 应用中注册类型

# config.yml
doctrine:
    dbal:
        types:
            tbbc_pgsql_binary_safe_array: "Tbbc\\Doctrine\\DBAL\\Pgsql\\Types\\BinarySafeArrayType"
            tbbc_pgsql_binary_safe_object: "Tbbc\\Doctrine\\DBAL\\Pgsql\\Types\\BinarySafeObjectType"

映射

<entity name="My\Entity" table="my_entity">
    <field name="myObject" type="tbbc_pgsql_binary_safe_object" />
    <field name="myArray" type="tbbc_pgsql_binary_safe_array" />
</entity>

安装

使用 Composer,只需运行

$ composer require tbbc/doctrine-dbal-pgsql-types

或者手动将其添加到您的 composer.json 文件中

{
  "require": {
    "tbbc/doctrine-dbal-pgsql-types": "dev-master"
  }
}

然后运行 composer update

运行测试

首先确保您已安装所有依赖项,运行

$ composer install --dev

然后,在根目录下运行测试

$ vendor/bin/phpunit

贡献

  1. 查看 问题列表
  2. 分支
  3. 编写测试(用于新功能或错误)
  4. 提交 PR

作者

许可

The Big Brains Company - Doctrine DBAL Types 基于 MIT 许可证许可 - 详细信息请参阅 LICENSE 文件