/**
  * Get image for rendition
  *
  * @param Newscoop\Image\Rendition $rendition
  * @return Newscoop\Image\ArticleImageRendition
  */
 public function offsetGet($rendition)
 {
     return array_key_exists((string) $rendition, $this->renditions) ? $this->renditions[(string) $rendition] : ($this->defaultImage !== null && $rendition->fits($this->defaultImage) ? $this->renditions[(string) $rendition] = new DefaultArticleRendition($this->articleNumber, $rendition, $this->defaultImage) : null);
 }
Ejemplo n.º 2
0
 /**
  * Get rendition name
  *
  * @return string
  */
 public function getName()
 {
     return $this->rendition->getName();
 }