Example #1
0
 /**
  * Tell if css file exists for a given View.
  *
  * @param View $view
  *
  * @return bool
  */
 public function cssFileExists(View $view)
 {
     $file = $this->getViewCssFileFromHash($view->getCssHash());
     return file_exists($file);
 }
Example #2
0
 /**
  * Change view cssHash, update css file and persist new cssHash.
  *
  * @param View $view
  */
 public function updateViewCss(View $view)
 {
     $oldHash = $view->getCssHash();
     $view->changeCssHash();
     //Update css file
     $this->widgetMapBuilder->build($view, true);
     $widgets = $this->widgetRepo->findAllWidgetsForView($view);
     $this->viewCssBuilder->updateViewCss($oldHash, $view, $widgets);
     //Update hash in database
     $metadata = $this->em->getClassMetadata(get_class($view));
     $this->uow->recomputeSingleEntityChangeSet($metadata, $view);
 }