/**
* @param Newscoop\Package\Item $item
*/
public function __construct(\Newscoop\Package\Item $item)
{
$this->caption = $item->getCaption();
$this->is_image = $item->isImage();
$this->is_video = $item->isVideo();
if ($item->isImage()) {
$thumbnail = $item->getRendition()->getThumbnail($item->getImage(), 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, 'original' => $item->getImage()->getPath());
} else {
$this->video = (object) array('url' => $item->getVideoUrl(), 'width' => $item->getRendition()->getWidth(), 'height' => $item->getRendition()->getHeight());
}
}