Esempio n. 1
0
 private function _applyTimePublished(array &$toReturn, array $json, $index)
 {
     $value = $this->_relativeQueryAsString($json, $index, array(tubepress_youtube3_impl_ApiUtility::RESOURCE_SNIPPET, 'publishedAt'));
     if ($value !== '') {
         $toReturn[tubepress_api_media_MediaItem::ATTRIBUTE_TIME_PUBLISHED_UNIXTIME] = $this->_timeUtils->rfc3339toUnixTime($value);
     }
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function formatDurationAttribute(tubepress_api_media_MediaItem $item, $sourceAttributeName, $destinationAttributeName)
 {
     if (!$item->hasAttribute($sourceAttributeName)) {
         return;
     }
     $seconds = $item->getAttribute($sourceAttributeName);
     $formatted = $this->_timeUtils->secondsToHumanTime($seconds);
     $item->setAttribute($destinationAttributeName, $formatted);
 }