swis/database-extra-bundle

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

Installs: 32 071

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 1

Open Issues: 1

Type:symfony-bundle

1.0.0 2013-07-27 11:49 UTC

This package is not auto-updated.

Last update: 2024-03-11 12:06:19 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",
        ...
    }
  1. 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