/**
  * @param \FSi\Bundle\AdminBundle\Admin\CRUD\BatchElement $element
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @return array
  * @throws \FSi\Bundle\AdminBundle\Exception\ContextBuilderException
  */
 private function getObjects(BatchElement $element, Request $request)
 {
     $objects = array();
     $indexes = $request->request->get('indexes', array());
     if (!count($indexes)) {
         throw new RequestHandlerException('There must be at least one object to execute batch action');
     }
     foreach ($indexes as $index) {
         $object = $element->getDataIndexer()->getData($index);
         if (!isset($object)) {
             throw new RequestHandlerException(sprintf("Can't find object with id %s", $index));
         }
         $objects[] = $object;
     }
     return $objects;
 }