tbbc/doctrine-dbal-pgsql-types

Doctrine types or fixed types for PostgreSQL.

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

This package is not auto-updated.

Last update: 2024-04-13 12:38:02 UTC


README

Build Status

This library adds or override some Doctrine DBAL types. Some types fixes issues with some database engines.

Quick Start

Registering Types in 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");

Registering Types in a Symfony2 application

# 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"

Mapping

<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>

Installation

Using Composer, just run:

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

Or add it manually to your composer.json file:

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

And run composer update.

Run the test

First make sure you have installed all the dependencies, run:

$ composer install --dev

then, run the test from within the root directory:

$ vendor/bin/phpunit

Contributing

  1. Take a look at the list of issues.
  2. Fork
  3. Write a test (for either new feature or bug)
  4. Make a PR

Authors

License

The Big Brains Company - Doctrine DBAL Types is licensed under the MIT License - see the LICENSE file for details