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 synchronize() { parent::synchronize(); $locale = $this->source['m_language']; $this->content = SQLIContent::create(new SQLIContentOptions( array( 'class_identifier' => self::$class_identifier, 'remote_id' => $this->remoteId(), 'language' => $locale ))); // Positionnement sous le publisher $publisher = MMSynchPublisherFolder::fetch($this->source['p_id']); MMSynchHelper::addLocation($this->content, $publisher->getContentMediaFile()->defaultLocation); if (!isset($this->content->fields[$locale])) $this->content->addTranslation($locale); $this->content->setActiveLanguage($locale); $this->populate(); $this->publish(); }
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']; }