private function parseStrTTTime($timeStr) { $matches = null; if (preg_match('/(\\d+)s/', $timeStr)) { return intval($matches[1]) * 1000; } return kXml::timeToInteger($timeStr); }
protected function parseCuePoint(SimpleXMLElement $scene) { if ($scene->getName() != 'scene-code-cue-point') { return null; } $cuePoint = parent::parseCuePoint($scene); if (!$cuePoint instanceof KalturaCodeCuePoint) { return null; } if (isset($scene->sceneEndTime)) { $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime); } if (isset($scene->code)) { $cuePoint->code = "{$scene->code}"; } if (isset($scene->description)) { $cuePoint->description = "{$scene->description}"; } return $cuePoint; }
protected function parseCuePoint(SimpleXMLElement $scene) { if ($scene->getName() != 'scene-annotation') { return null; } $cuePoint = parent::parseCuePoint($scene); if (!$cuePoint instanceof KalturaAnnotation) { return null; } if (isset($scene->sceneEndTime)) { $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime); } if (isset($scene->sceneText)) { $cuePoint->text = "{$scene->sceneText}"; } if (isset($scene->parentId)) { $cuePoint->parentId = "{$scene->parentId}"; } elseif (isset($scene->parent)) { $cuePoint->parentId = $this->getCuePointId("{$scene->parent}"); } return $cuePoint; }
protected function parseCuePoint(SimpleXMLElement $scene) { if ($scene->getName() != 'scene-ad-cue-point') { return null; } $cuePoint = parent::parseCuePoint($scene); if (!$cuePoint instanceof KalturaAdCuePoint) { return null; } if (isset($scene->sceneEndTime)) { $cuePoint->endTime = kXml::timeToInteger($scene->sceneEndTime); } if (isset($scene->sceneTitle)) { $cuePoint->title = "{$scene->sceneTitle}"; } if (isset($scene->sourceUrl)) { $cuePoint->sourceUrl = "{$scene->sourceUrl}"; } $cuePoint->adType = "{$scene->adType}"; $cuePoint->protocolType = "{$scene->protocolType}"; return $cuePoint; }
public static function parseXml(SimpleXMLElement $scene, $partnerId, CuePoint $cuePoint = null) { if ($scene->getName() != 'scene-ad-cue-point') { return $cuePoint; } if (!$cuePoint) { $cuePoint = kCuePointManager::parseXml($scene, $partnerId, new AdCuePoint()); } if (!$cuePoint instanceof AdCuePoint) { return null; } if (isset($scene->sceneEndTime)) { $cuePoint->setEndTime(kXml::timeToInteger($scene->sceneEndTime)); } if (isset($scene->sceneTitle)) { $cuePoint->setName($scene->sceneTitle); } if (isset($scene->sourceUrl)) { $cuePoint->setSourceUrl($scene->sourceUrl); } $cuePoint->setAdType($scene->adType); $cuePoint->setSubType($scene->protocolType); return $cuePoint; }
public static function parseXml(SimpleXMLElement $scene, $partnerId, CuePoint $cuePoint = null) { if ($scene->getName() != 'scene-annotation') { return $cuePoint; } if (!$cuePoint) { $cuePoint = kCuePointManager::parseXml($scene, $partnerId, new Annotation()); } if (!$cuePoint instanceof Annotation) { return null; } $cuePoint->setEndTime(kXml::timeToInteger($scene->sceneEndTime)); if (isset($scene->sceneText)) { $cuePoint->setText($scene->sceneText); } $parentCuePoint = null; if (isset($scene->parentId)) { $parentCuePoint = CuePointPeer::retrieveByPK($scene->parentId); } elseif (isset($scene->parent)) { $parentCuePoint = CuePointPeer::retrieveBySystemName($cuePoint->getEntryId(), $scene->parent); } if ($parentCuePoint) { $cuePoint->setParentId($parentCuePoint->getId()); } return $cuePoint; }
/** * @param SimpleXMLElement $scene * @param int $partnerId * @param CuePoint $newCuePoint * @return CuePoint */ public static function parseXml(SimpleXMLElement $scene, $partnerId, CuePoint $newCuePoint = null) { $cuePoint = null; $entryId = $scene['entryId']; $entry = entryPeer::retrieveByPK($entryId); if (!$entry) { throw new kCoreException("Entry [{$entryId}] not found", kCoreException::INVALID_ENTRY_ID); } if (isset($scene['sceneId']) && $scene['sceneId']) { $cuePoint = CuePointPeer::retrieveByPK($scene['sceneId']); } if (!$cuePoint && isset($scene['systemName']) && $scene['systemName']) { $cuePoint = CuePointPeer::retrieveBySystemName($entryId, $scene['systemName']); } if (!$cuePoint) { $cuePoint = $newCuePoint; } $cuePoint->setPartnerId($partnerId); $cuePoint->setStartTime(kXml::timeToInteger($scene->sceneStartTime)); $tags = array(); foreach ($scene->tags->children() as $tag) { $value = "{$tag}"; if ($value) { $tags[] = $value; } } $cuePoint->setTags(implode(',', $tags)); $cuePoint->setEntryId($entryId); if (isset($scene['systemName'])) { $cuePoint->setSystemName($scene['systemName']); } return $cuePoint; }
/** * @param SimpleXMLElement $scene * @return KalturaCuePoint */ protected function parseCuePoint(SimpleXMLElement $scene) { $cuePoint = $this->getNewInstance(); if (isset($scene['systemName']) && $scene['systemName']) { $cuePoint->systemName = $scene['systemName'] . ''; } $cuePoint->startTime = kXml::timeToInteger($scene->sceneStartTime); $tags = array(); foreach ($scene->tags->children() as $tag) { $value = "{$tag}"; if ($value) { $tags[] = $value; } } $cuePoint->tags = implode(',', $tags); return $cuePoint; }
public static function parseXml(SimpleXMLElement $scene, $partnerId, CuePoint $cuePoint = null) { if ($scene->getName() != 'scene-code-cue-point') { return $cuePoint; } if (!$cuePoint) { $cuePoint = kCuePointManager::parseXml($scene, $partnerId, new CodeCuePoint()); } if (!$cuePoint instanceof CodeCuePoint) { return null; } if (isset($scene->sceneEndTime)) { $cuePoint->setEndTime(kXml::timeToInteger($scene->sceneEndTime)); } if (isset($scene->code)) { $cuePoint->setName($scene->code); } if (isset($scene->description)) { $cuePoint->setText($scene->description); } return $cuePoint; }
/** * @param SimpleXMLElement $scene * @param int $partnerId * @param CuePoint $newCuePoint * @return CuePoint */ public static function parseXml(SimpleXMLElement $scene, $partnerId, CuePoint $newCuePoint = null) { $cuePoint = null; if (isset($scene['sceneId']) && $scene['sceneId']) { $cuePoint = CuePointPeer::retrieveByPK($scene['sceneId']); } if (!$cuePoint && isset($scene['systemName']) && $scene['systemName']) { $cuePoint = CuePointPeer::retrieveBySystemName($scene['entryId'], $scene['systemName']); } if (!$cuePoint) { $cuePoint = $newCuePoint; } $cuePoint->setPartnerId($partnerId); $cuePoint->setStartTime(kXml::timeToInteger($scene->sceneStartTime)); $tags = array(); foreach ($scene->tags->children() as $tag) { $value = "{$tag}"; if ($value) { $tags[] = $value; } } $cuePoint->setTags(implode(',', $tags)); $cuePoint->setEntryId($scene['entryId']); if (isset($scene['systemName'])) { $cuePoint->setSystemName($scene['systemName']); } return $cuePoint; }