dev-master
9999999-devSymfony CoshiVariatorBundle
MIT
The Requires
v0.0.2
0.0.2.0Symfony CoshiVariatorBundle
MIT
The Requires
v0.0.1
0.0.1.0Symfony CoshiVariatorBundle
MIT
The Requires
Symfony CoshiVariatorBundle
Allows to specify callbacks with services:, (*1)
'text' => [ 'type' => 'int', 'min' => 0, 'max' => ['@some_service', 'someMethod']
Brings new variation type: "iteratorResult" to operate over the Doctrine IterableResult, (*2)
Usage:, (*3)
$builder = $container->get('coshi.variator_bundle.builder'); $config = [ 'id' => [ 'type' => 'iteratorResult', 'callback' => ['@some_repository', 'getSomeIds'], ], ]; $variations = $builder->build($config); foreach ($variations as $values) { foreach($values as $value) { print($value); // displays ids one by one } }
You can strip values to several chunks. Variator will then fetch the data using LIMIT and OFFSET SQL statements:, (*4)
$builder = $container->get('coshi.variator_bundle.builder'); $config = [ 'id' => [ 'type' => 'iteratorResult', 'callback' => ['@some_repository', 'getSomeIds'], 'chunked' => true, 'chunk_size' => 100 ], ]; $variations = $builder->build($config); foreach ($variations as $values) { foreach($values as $value) { print($value); // displays ids one by one, same as in previous } }
Symfony CoshiVariatorBundle
MIT
Symfony CoshiVariatorBundle
MIT
Symfony CoshiVariatorBundle
MIT