swis/database-extra-bundle

This bundle extends the behaviour of a SQLite database in a Symfony2 project.

Installs: 3 021

Dependents: 0

Stars: 2

Watchers: 1

Language: PHP

1.0.0 2013-07-27 11:49 UTC

README

This bundle provides additional features for databases in any Symfony 2 project.

Core features

  • Trigonometric and other additional functions for SQLite (ACOS, COS, RADIANS, SIN, SQRT, MOD, LOCATE)
  • DQL definitions of trigonometric functions for their usage with Doctrine (ACOS, COS, RADIANS, SIN)

Instructions

1) Include the bundle in your composer.json

    "require": {
        ...
        "swis/database-extra-bundle": "dev-master",
        ...
    }

2) Enable it in your AppKernel.php

    $bundles = array(
        ...
        new Swis\Bundle\DatabaseExtraBundle\SwisDatabaseExtraBundle(),
        ...
    );

3a) For enabling the SQLite driver, edit your config.yml:

doctrine:
    dbal:
        connections:
            default:
                driver_class:                 \Swis\Bundle\DatabaseExtraBundle\Driver\Sqlite

3b) For enabling the DQL functions, edit your config.yml:

doctrine:
    orm:
        entity_managers:
            default:
                dql:
                    numeric_functions:
                        acos:         Swis\Bundle\DatabaseExtraBundle\DQL\Acos
                        cos:          Swis\Bundle\DatabaseExtraBundle\DQL\Cos
                        radians:      Swis\Bundle\DatabaseExtraBundle\DQL\Radians
                        sin:          Swis\Bundle\DatabaseExtraBundle\DQL\Sin