protected function populate() { parent::populate(); $fileOrLinkPopulated = false; if (!empty($this->source['m_file'])) { $this->file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::PDF_FOLDER, $this->source['m_file']); $this->content->fields->file = $this->file->getFullPath(); $fileOrLinkPopulated = true; } if (!empty($this->source['pdf_link'])) { $this->content->fields->link = $this->source['pdf_link']; $fileOrLinkPopulated = true; } if (!$fileOrLinkPopulated) { throw new MMSynchException("Either file or link should be populated for PDF file."); } $this->content->fields->source = $this->source['pdf_source']; $this->content->fields->expiration_duration = $this->source['pdf_expiration_duration']; $this->content->fields->media_target = $this->source['pdf_media_target']; $this->content->fields->link = $this->source['pdf_link']; }
protected function populate() { parent::populate(); $this->file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::FILE_FOLDER, $this->source['m_file']); $this->content->fields->file = $this->file->getFullPath(); $this->content->fields->media_target = $this->source['file_media_target']; }
protected function populate() { parent::populate(); $this->file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::AUDIO_FOLDER, $this->source['m_file']); $this->content->fields->file = sprintf('%s||%s', $this->file->getFullPath(), $this->getPublisher()->getFolder()); $this->content->fields->screen_capture = MMSynchHelper::binaryToFile($this->source['audio_screen_capture']); $this->content->fields->duration = $this->source['audio_duration']; }
protected function populate() { parent::populate(); $this->file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::IMAGE_FOLDER, $this->source['m_file']); $this->content->fields->file = $this->file->getFullPath(); $this->content->fields->original_size = $this->source['i_original_size']; $this->content->fields->alternate_text = $this->source['i_alternate_text']; }
protected function populate() { parent::populate(); if(!is_null($this->source['html_media_file']) && $this->source['html_media_file'] != '') { $file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::HTML_FOLDER, $this->source['html_media_file']); $parser = new MMSynchHtmlMediaParser(self::getFileContent($file->getFullPath()), $this); $this->content->fields->text = $parser->getRichContent(); } else { $parser = new MMSynchHtmlMediaParser($this->source['html_media_html_content'], $this); $this->content->fields->text = $parser->getRichContent(); } $this->content->fields->title = $this->source['html_media_headline']; }
protected function populate() { parent::populate(); $id = false; if ($this->source['video_brightcoveid'] != '') { $id = $this->source['video_brightcoveid']; } $filepath = false; if ($this->source['m_file']) { try { $this->file = MMSynchFileManager::fromRoot($this->getPublisher(), MMSynchFileManager::VIDEO_FOLDER, $this->source['m_file']); $filepath = $this->file->getFullPath(); } catch(Exception $e) { if ($id) { MMSynchLog::warning($this, $e->getMessage()); } else { throw MMSynchException::fromException($e); } } } $this->content->fields->file = sprintf('%s|%s|%s', $filepath, $id, $this->getPublisher()->getFolder()); $this->content->fields->screen_capture = MMSynchHelper::binaryToFile($this->source['video_screen_capture']); $this->content->fields->duration = $this->source['video_duration']; $this->content->fields->original_size = $this->source['video_original_size']; }