2017 © Pedro Peláez
 

library slim-middleware-doctrine-orm

Slim Framework Middleware to integrate Doctrine ORM

image

cubicmushroom/slim-middleware-doctrine-orm

Slim Framework Middleware to integrate Doctrine ORM

  • Monday, March 2, 2015
  • by ToG
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Slim Doctrine ORM Middleware

Slim Middleware to make integrating Doctrine ORM easy, (*1)

Setup

First of all, add the 'doctrine' config to the Slim application..., (*2)

use CubicMushroom\Slim\Middleware\DoctrineORMMiddleware;

$config = [
    'doctrine' => [
        'driver' => 'pdo_mysql'
        'host' => 'localhost'
        'user' => 'dbUser'
        'password' => 'dbPassword'
        'port' => '3306'
        'dbname' => 'dbName'
    ],
];

$app = new \Slim\Slim($config);

// ...

The Middleware will use the config details from the app 'doctrine' config, unless you specify an alternative key in the options array, so all you then need to do is add the Middleware..., (*3)

// ...

$options = [
   'annotationMetadataPaths' => ['path/to/entities']
];

$app->add(new DoctrineORMMiddleware($options));

// ...

The only required option is the annotationMetadataPaths key which should contain an array of paths to check for entity class annotations., (*4)

Options

Below are lists all the supported options you can pass to the constructor., (*5)

Each of the options is defined as a class constant on the DoctrineORMMiddleware, so you could use these when passing the options array in, to protect against any future changes., (*6)

settingsKey (optional)

Default: doctrine, (*7)

The key within the app config settings that the d/b connection details can be found, (*8)

serviceName (optional)

Default: @entity_manager, (*9)

The service name used for the entity manager service, (*10)

annotationMetadataPaths (required)

An array of paths to check for entity annotations, (*11)

annotationsAutoloaders (optional)

Default: array(), (*12)

An array of class autoloaders to use when loading annotation classes., (*13)

Will be passed to Doctrine's \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() method when setting up service, to support loading of annotation classes., (*14)

annotationsFiles (optional)

Default: array(), (*15)

An array of files to load when attempting to load annotation classes., (*16)

Will be passed to Doctrine's \Doctrine\Common\Annotations\AnnotationRegistry::registerFile() method when setting up service, to support loading of annotation classes., (*17)

annotationNamespaces (optional)

Default: array(), (*18)

An array of mappings of namespaces to directory paths to use when loading annotation classes., (*19)

Will be passed to Doctrine's \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace() method when setting up service, to support loading of annotation classes., (*20)

The Versions

02/03 2015

dev-master

9999999-dev

Slim Framework Middleware to integrate Doctrine ORM

  Sources   Download

proprietary

The Requires

 

by Toby Griffiths

02/03 2015

0.1.1

0.1.1.0

Slim Framework Middleware to integrate Doctrine ORM

  Sources   Download

proprietary

The Requires

 

by Toby Griffiths

02/03 2015

0.1.0

0.1.0.0

Slim Framework Middleware to integrate Doctrine ORM

  Sources   Download

proprietary

The Requires

 

by Toby Griffiths