2017 © Pedro Peláez
 

symfony-bundle variator-bundle

Symfony CoshiVariatorBundle

image

coshi/variator-bundle

Symfony CoshiVariatorBundle

  • Wednesday, August 24, 2016
  • by kozog
  • Repository
  • 8 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

A Symfony bundle wrapper for coshi/variator library

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            
        }
    }

The Versions

24/08 2016

dev-master

9999999-dev

Symfony CoshiVariatorBundle

  Sources   Download

MIT

The Requires

 

24/08 2016

v0.0.2

0.0.2.0

Symfony CoshiVariatorBundle

  Sources   Download

MIT

The Requires

 

23/08 2016

v0.0.1

0.0.1.0

Symfony CoshiVariatorBundle

  Sources   Download

MIT

The Requires