Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function getImage()
 {
     if ($this->config['getBiggerImage']) {
         $allImages = $this->images;
         if (empty($allImages)) {
             return;
         }
         $allImages = [$allImages];
     } else {
         $allImages = Utils::sortByProviders($this->images);
     }
     foreach ($allImages as $images) {
         if (($key = Utils::getBiggerValue($images, true)) !== null) {
             $image = $images[$key];
             if ($image['width'] >= $this->config['minImageWidth'] && $image['height'] >= $this->config['minImageHeight']) {
                 return $image['value'];
             }
         }
     }
 }