2017 © Pedro Peláez
 

library respect-relational-silex-provider

Respect Relational Service Provider to use with Silex microframework

image

williancarminato/respect-relational-silex-provider

Respect Relational Service Provider to use with Silex microframework

  • Thursday, September 19, 2013
  • by williancarminato
  • Repository
  • 2 Watchers
  • 7 Stars
  • 22 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Respect Relational Service Provider Build Status

Provides Respect Relational Mapper to use as services on Silex applications., (*1)

Features

  • Awesome Relational database persistence tool, see Respect/Relational
  • Multiple databases connections

Requirements

  • PHP 5.3+
  • Respect/Relational

Instalation

Package available on Composer. Autoloading with composer is PSR-0 compatible., (*2)

Usage

To use the provider, register RespectRelationalServiceProvider and specify at least one connection., (*3)

<?php 
    use Silex\Application;
    use Carminato\Silex\Provider\Respect\RespectRelationalServiceProvider;

    $app = new Application;

    $app->register(new RespectRelationalServiceProvider(), array(
            'respect.pdo.instances' => array(new \PDO('sqlite::memory:'))
        )
    );

The default Mapper will now be accessible with respect.mapper in the app container., (*4)

<?php
    $mapper = $app['respect.mapper'];

You can pass as many respect.pdo.instances as you want., (*5)

<?php 
    use Silex\Application;
    use Carminato\Silex\Provider\Respect\RespectRelationalServiceProvider;

    $app = new Application;

    $app->register(new RespectRelationalServiceProvider(), array(
            'respect.pdo.instances' => array(
                'mymapper1' => new \PDO('sqlite::memory:'),
                'mymapper2' => new \PDO('sqlite::memory:')
            )
        )
    );

And then access each one with his respective array key using the respect.mappers., (*6)

<?php
    $mapper1 = $app['respect.mappers']['mymapper1']
    $mapper2 = $app['respect.mappers']['mymapper2']

Enjoy!

The Versions

19/09 2013

dev-master

9999999-dev http://github.com/williancarminato/respect-relational-silex-provider

Respect Relational Service Provider to use with Silex microframework

  Sources   Download

MIT

The Requires

 

by Willian Campideli

19/09 2013

dev-develop

dev-develop http://github.com/williancarminato/respect-relational-silex-provider

Respect Relational Service Provider to use with Silex microframework

  Sources   Download

MIT

The Requires

 

by Willian Campideli