getCaption() public method

Get caption.
public getCaption ( ) : string
return string
 /**
  * @param Newscoop\Package\Item $item
  */
 public function __construct(\Newscoop\Package\Item $item)
 {
     global $Campsite;
     $this->item = $item;
     $this->caption = $item->getCaption();
     $this->is_image = $item->isImage();
     $this->is_video = $item->isVideo();
     if ($item->isImage()) {
         $image = $item->getImage();
         $thumbnail = $item->getRendition()->getThumbnail($image, Zend_Registry::get('container')->getService('image'));
         $this->image = (object) array('src' => Zend_Registry::get('view')->url(array('src' => $thumbnail->src), 'image', true, false), 'width' => $thumbnail->width, 'height' => $thumbnail->height, 'id' => $image->getId(), 'caption' => $item->getCaption() ?: $item->getImage()->getCaption(), 'photographer' => $image->getPhotographer(), 'photographer_url' => $image->getPhotographerUrl(), 'original' => $image->getPath());
     } else {
         $this->video = (object) array('url' => $item->getVideoUrl(), 'width' => $item->getRendition()->getWidth(), 'height' => $item->getRendition()->getHeight());
     }
 }
Esempio n. 2
0
 /**
  * Set default for given entity
  *
  * @param Newscoop\Package\Item $item
  * @return Admin_Form_SlideshowItem
  */
 public function setDefaultsFromEntity(\Newscoop\Package\Item $item)
 {
     $this->setDefaults(array('caption' => $item->getCaption(), 'url' => $item->getVideoUrl()));
     return $this;
 }
 public function getCaption()
 {
     $this->__load();
     return parent::getCaption();
 }