/**
  * @param Request $request
  * @return View
  * @throws \AppShed\Extensions\StorageBundle\Exception\MissingAppParametersException
  */
 protected function getView(Request $request)
 {
     $params = $this->getExtensionParameters($request);
     $view = $this->getDoctrine()->getRepository('AppShedExtensionsStorageBundle:View')->findOneBy(['itemId' => $params['itemid'], 'identifier' => $params['identifier']]);
     if (!$view) {
         $view = new View();
         $view->setItemId($params['itemid']);
         $view->setIdentifier($params['identifier']);
         $this->getDoctrine()->getManager()->persist($view);
     }
     return $view;
 }
 /**
  * @param View $view
  * @return Data[]
  */
 public function getDataForView(View $view)
 {
     return $this->getFilteredData($view->getStore(), new ArrayCollection($view->getFilters()->toArray()));
 }