2017 © Pedro Peláez
 

symfony-bundle repository-service-bundle

A symfony bundle to help you register automatically doctrine ORM repositories as services

image

docteurklein/repository-service-bundle

A symfony bundle to help you register automatically doctrine ORM repositories as services

  • Thursday, September 8, 2016
  • by florian.klein@free.fr
  • Repository
  • 0 Watchers
  • 2 Stars
  • 3,729 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

RepositoryServiceBundle

What ?

A symfony bundle that eases creation of doctrine ORM repositories as services., (*1)

It will create a service for each registered entity in the default entity manager., (*2)

If you provide a repository tag for a service, it will automatically create an alias and configure doctrine to make it the custom repository class of the associated entity (specified by the for attribute)., (*3)

How ?

install

composer require docteurklein/repository-service-bundle

register the bundle

``` php, (*4)

public function registerBundles()
{
    $bundles = [
        new \DocteurKlein\RepositoryServiceBundle,
        // …
    ];

    return $bundles;
}

## Examples > Note: The following examples use JmsDiExtraBundle to simplify code. Given an entity: ```php namespace Model; /** @ORM\Entity */ class Product { /** @ORM\Id */ private $id; }

And the following service:, (*5)

namespace Repository;

/**
 * @Service("products")
 * @Tag("repository", attributes={"for"="Model\Product"})
 */
final class Products extends EntityRepository
{
}

Then the DIC contains a factory service named repo.model_product for the repository (using ManagerRegistry::getRepository())., (*6)

It also contains an alias named products pointing to the repo.model_product service., (*7)

The custom repository class is automatically configured to point to Repository\\Products., (*8)

The Versions

08/09 2016

dev-master

9999999-dev

A symfony bundle to help you register automatically doctrine ORM repositories as services

  Sources   Download

MIT

The Requires

 

The Development Requires

08/09 2016

1.0.0

1.0.0.0

A symfony bundle to help you register automatically doctrine ORM repositories as services

  Sources   Download

MIT

The Requires

 

The Development Requires