Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function batch(GridInterface $grid, $batch, $data)
 {
     $batch = $grid->getBatch($batch);
     $types = $this->resolveTypes($batch->getType());
     if (!isset($this->cache[$hash = spl_object_hash($grid) . ':' . spl_object_hash($batch)])) {
         $resolver = new OptionsResolver();
         foreach ($types as $type) {
             $type->configureOptions($resolver);
         }
         $this->cache[$hash] = $resolver->resolve(array_merge(['batch' => $batch, 'grid' => $grid], $batch->getOptions()));
     }
     reset($types)->batch($data, $this->cache[$hash]);
 }