Exemplo n.º 1
0
 /**
  * @param MediaItem
  * @return MediaItem
  */
 public function createMediaItem(MediaItem $video)
 {
     $statement = $this->_dbCon->query('INSERT INTO `video` (?,?,?,?,?,?,?,?,?,?)', array(null, $video->getTitle(), $video->getLink(), $video->getThumbsUp(), $video->getThumbsDown(), $video->getChannelId(), $video->getChannelTitle(), $video->getThumbnail(), $video->getDescription(), $video->getDuration()));
     $driver = $this->_dbCon->getDriver();
     $video->setId($driver->getLastGeneratedValue());
     return $video;
 }
Exemplo n.º 2
0
 public function convertMediaItemToArray(MediaItem $mediaItem)
 {
     return array("id" => $mediaItem->getLink(), "title" => $mediaItem->getTitle(), "description" => $mediaItem->getDescription(), "channelId" => $mediaItem->getChannelId(), "channelTitle" => $mediaItem->getChannelTitle(), "thumbnail" => $mediaItem->getThumbnail(), "duration" => $this->convertSecondsToTime($mediaItem->getDuration()));
 }