shapecode / repository-as-a-service
Symfony2 Bundle which you can register repositories easily.
Installs: 1 038
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ~5.6|~7.0
- doctrine/doctrine-bundle: ~1.6
- doctrine/orm: ~2.5
- symfony/config: ~2.8|~3.0|~4.0
- symfony/dependency-injection: ~2.8|~3.0|~4.0
- symfony/doctrine-bridge: ~2.8|~3.0|~4.0
- symfony/framework-bundle: ~2.8|~3.0|~4.0
- symfony/http-kernel: ~2.8|~3.0|~4.0
This package is auto-updated.
Last update: 2022-02-01 12:46:05 UTC
README
This bundle allows to register repositories as a service.
Install instructions
Installing this bundle can be done through these simple steps:
Add the bundle to your project as a composer dependency:
// composer.json { // ... require: { // ... "shapecode/repository-as-a-service": "~1.2" } }
Update your composer installation:
$ composer update
Add the bundle to your application kernel:
<?php // application/ApplicationKernel.php public function registerBundles() { // ... $bundle = array( // ... new Shapecode\Bundle\RasSBundle\ShapecodeRasSBundle(), ); // ... return $bundles; }
Start using the bundle and set repositories as services:
app.repository.example: class: %app.repository.example.class% tags: - { name: doctrine.repository, class: %app.entity.example.class%, alias: example_repository }
or let the bundle do the job for you. It creates automatically services for you. Just access it with "lowercaseentitnyname_repository".
<?php $this->getContainer()->get('lowercaseentitnyname_repository');
The old way to get repository is also supported. If you get them like this ...
<?php $this->getRepository('ShapecodeRasSBundle:TestEntity');
... you get the service off the repository instead.