fle/postgresql-type-bundle

This bundle extend support of postgresql for doctrine


Keywords
doctrine, postgresql
License
MIT

Documentation

PostgresqlTypeBundle

Build Status

Dependency Status

Coverage Status

SensioLabsInsight

Overview

Supported Types

Add support to postgresql type.

  • Box
  • Point
  • Cidr
  • DateInterval
  • DateTime
  • DateTime[]
  • DateTime with TimeZone
  • Time
  • Time[]
  • Time with TimeZone
  • JSON
  • JSONB
  • int[]: array(-2147483648, 1, 2, 3, 4, 5, +2147483647)
  • bigint[]: array(-9223372036854775808, 1, 2, 3, 9223372036854775807)
  • text[]: array("Hello", "World")
  • text[][]: array("first" => "Hello", "last" => "World")

Supported Functions

Add support of functions.

  • CONTAINTS SELECT CONTAINTS(ARRAY[1,2,3], 2);
  • date_trunc date_trunc('hour', timestamp '2001-02-16 20:38:40')

ManyToAny

Add ManyToAny Annotation

<?php

use Doctrine\ORM\Mapping as ORM;
use FLE\Bundle\PostgresqlTypeBundle\Annotation\ManyToAny;

/**
 * @ORM\Entity
 */
class MyEntity
{
    /**
     * @var mixed
     * @ManyToAny()
     */
    protected $mixedEntity;
    //...
}

Installation

Add the bunde to your composer.json file:

{
    "require": {
        "fle/postgresql-type-bundle": "1.*@dev"
    }
}

Then run a composer update:

composer.phar update fle/postgresql-type-bundle # to only update the bundle

Register the bundle with your kernel in AppKernel::registerBundles():

<?php
$bundles = array(
    // ...
    new FLE\Bundle\PostgresqlTypeBundle\FLEPostgresqlTypeBundle(),
    // ...
);

Usage

Point

To use Point twig template:

twig:
    form_themes:
        - 'FLEPostgresqlTypeBundle::Form/point_type_bootstrap3.html.twig'