Ejemplo n.º 1
0
 /**
  * Get default image url with the given filter applied.
  *
  * @param string $filter
  *
  * @return string
  */
 public function getDefaultImageUrl($filter)
 {
     $config = $this->filterConfig->get($filter);
     $defaultImage = null;
     if (false == empty($config['default_image'])) {
         $defaultImage = $config['default_image'];
     } elseif (!empty($this->globalDefaultImage)) {
         $defaultImage = $this->globalDefaultImage;
     }
     return $defaultImage;
 }
 /**
  * @param string|string[]|null $paths
  * @param string|string[]|null $filters
  */
 public function remove($paths = null, $filters = null)
 {
     if (null === $filters) {
         $filters = array_keys($this->filterConfig->all());
     }
     if (!is_array($filters)) {
         $filters = array($filters);
     }
     if (!is_array($paths)) {
         $paths = array($paths);
     }
     $paths = array_filter($paths);
     $filters = array_filter($filters);
     $mapping = new \SplObjectStorage();
     foreach ($filters as $filter) {
         $resolver = $this->getResolver($filter);
         $list = isset($mapping[$resolver]) ? $mapping[$resolver] : array();
         $list[] = $filter;
         $mapping[$resolver] = $list;
     }
     foreach ($mapping as $resolver) {
         $resolver->remove($paths, $mapping[$resolver]);
     }
 }