2017 © Pedro Peláez
 

library doctrineormserviceprovider

Doctrine ORM for Silex

image

mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  • Thursday, September 4, 2014
  • by Mparaiso
  • Repository
  • 0 Watchers
  • 0 Stars
  • 276 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

Doctrine ORM Service Provider

Build Status, (*1)

Doctrine ORM silex extension

author : M.Paraiso contact: mparaiso@online.fr, (*2)

status: work in progress, (*3)

helps use Doctrine ORM with silex, (*4)

Configuration

here is a configuration exemple for silex:, (*5)

$app->register(new ConsoleServiceProvider); // to manage entities through command line.
$app->register(new DoctrineServiceProvider,array(
        "db.options"=> array(
            "dbname"   =>  getenv("DBNAME"),
            "user"     => getenv("USER"),
            "password" => getenv("PASSWORD"),
            "host"     => getenv("_HOST"),
            "driver"   => "pdo_mysql",
)));

$app->register(new DoctrineORMServiceProvider, array(
       "orm.driver.configs"    => array(
           "default" => array(
               "namespace"=>"Entity",  // rootnamespace of your entities
               "type"  => "yaml", // driver type (yaml,xml,annotation)
               "paths" => array(__DIR__ . '/doctrine'), // config file path
           )
       )
   ));

Services :, (*6)

  • orm.em : EntityManager
  • orm.manager_registry : Manager registry

FEATURES

Date Function

exemple : select j from Job j where j.createdAt = date("2008-12-26"), (*7)

FixtureLoader

load fixtures from a yaml file, (*8)

Usage

given the following yaml file :, (*9)

/*, (*10)


## fixture example : # !!!! all references must be declared BEFORE used !!!!! # the root node fixtures: # a fixture - entity: Entity\Rdv\Rsvp # the class name: jacob # the fixture reference name (optional) fields: # the fixture properties attendeeName: jacob - entity: Entity\Rdv\Dinner name: 'German dinner' fields: country: Germany latitude: 10 longitude: 23 contactPhone: 911-343-333 address: Berlin description: Sausages title: Kraut party hostedBy: Von Brohm eventDate: { datetime: 2013-10-20 } # will be parsed as a DateTime object rsvps: [ jacob ] # will be parsed as an ArrayCollection , fixtures are references by their names # references must be declared BEFORE they are USED !!!! - entity: Entity\Rdv\Rsvp name: jean fields: attendeeName: jean dinner: %German dinner% # a reference to another fixture , with its name surrounded by quotes
        $em = app['orm.em'] // given a EntityManager
        $loader = new Mparaiso\Doctrine\ORM\FixtureLoader(__DIR__ . '/fixtures/dinners.yml');
        // get entities from fixtures
        $entities = $loader->parse();
        // persist fixtures
        $loader->persistFixtures($em);
        // remove fixtures
        $loader->removeFixtures($em);

The Versions

04/09 2014

dev-master

9999999-dev https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

04/09 2014
02/09 2014

0.0.21

0.0.21.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

02/09 2014

0.0.20

0.0.20.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

02/09 2014

0.0.9

0.0.9.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

26/04 2013

0.0.19

0.0.19.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

26/04 2013

0.0.18

0.0.18.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

19/04 2013

dev-dev

dev-dev https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

02/04 2013

0.0.8

0.0.8.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

02/04 2013

0.0.7

0.0.7.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

02/04 2013

0.0.6

0.0.6.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

25/03 2013

0.0.5

0.0.5.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

25/03 2013

0.0.4

0.0.4.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

25/03 2013

dev-ManagerRegistry

dev-ManagerRegistry https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

25/03 2013

0.0.3

0.0.3.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

by Avatar Mparaiso

orm extensions silex doctrine

24/03 2013

0.0.2

0.0.2.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Mparaiso

orm extensions silex doctrine

24/03 2013

0.0.1

0.0.1.0 https://github.com/Mparaiso/doctrineormserviceprovider

Doctrine ORM for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Mparaiso

orm extensions silex doctrine