makasim / yadm-bundle
Installs: 4 700
Dependents: 1
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 2
Type:symfony-bundle
Requires
- php: >=7.0
- makasim/yadm: ^0.5
Suggests
- doctrine/data-fixtures: ^1.2 If you want to use fixrue load command
README
Install
Install library
$ composer require formapro/yadm-bundle "mikemccabe/json-patch-php:dev-master as 0.1.1"
Register the bundle
<?php # /app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ new \Formapro\Yadm\Bundle\YadmBundle(), ]; return $bundles; } }
Configure
yadm: mongo_uri: 'mongodb://mongo:27017/db_name' models: category: class: 'Acme\Model\Category' collection: 'category' product: class: 'Acme\Model\Product' collection: 'product' hydrator: 'app.product.hydrator'
Usage
In your code you can get the storage from registry:
<?php $registry = $container->get('yadm'); $productStorage = $registry->getStorage('Acme\Model\Category');
Licence
MIT