Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / zendframework / zend-feed / src / Reader / Extension / Podcast / Entry.php
index e18bc387b19ddfc836bc7623bf82c495f4c816f1..7060fa3c751536396e48a314903f8068cf76d899 100644 (file)
@@ -1,18 +1,14 @@
 <?php
 /**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link      http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
- * @license   http://framework.zend.com/license/new-bsd New BSD License
+ * @see       https://github.com/zendframework/zend-feed for the canonical source repository
+ * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
+ * @license   https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
  */
 
 namespace Zend\Feed\Reader\Extension\Podcast;
 
 use Zend\Feed\Reader\Extension;
 
-/**
-*/
 class Entry extends Extension\AbstractEntry
 {
     /**
@@ -106,10 +102,18 @@ class Entry extends Extension\AbstractEntry
     /**
      * Get the entry keywords
      *
+     * @deprecated since 2.10.0; itunes:keywords is no longer part of the
+     *     iTunes podcast RSS specification.
      * @return string
      */
     public function getKeywords()
     {
+        trigger_error(
+            'itunes:keywords has been deprecated in the iTunes podcast RSS specification,'
+            . ' and should not be relied on.',
+            \E_USER_DEPRECATED
+        );
+
         if (isset($this->data['keywords'])) {
             return $this->data['keywords'];
         }
@@ -169,6 +173,114 @@ class Entry extends Extension\AbstractEntry
         return $this->data['summary'];
     }
 
+    /**
+     * Get the entry image
+     *
+     * @return string
+     */
+    public function getItunesImage()
+    {
+        if (isset($this->data['image'])) {
+            return $this->data['image'];
+        }
+
+        $image = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:image/@href)');
+
+        if (! $image) {
+            $image = null;
+        }
+
+        $this->data['image'] = $image;
+
+        return $this->data['image'];
+    }
+
+    /**
+     * Get the episode number
+     *
+     * @return null|int
+     */
+    public function getEpisode()
+    {
+        if (isset($this->data['episode'])) {
+            return $this->data['episode'];
+        }
+
+        $episode = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:episode)');
+
+        if (! $episode) {
+            $episode = null;
+        }
+
+        $this->data['episode'] = null === $episode ? $episode : (int) $episode;
+
+        return $this->data['episode'];
+    }
+
+    /**
+     * Get the episode number
+     *
+     * @return string One of "full", "trailer", or "bonus"; defaults to "full".
+     */
+    public function getEpisodeType()
+    {
+        if (isset($this->data['episodeType'])) {
+            return $this->data['episodeType'];
+        }
+
+        $type = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:episodeType)');
+
+        if (! $type) {
+            $type = 'full';
+        }
+
+        $this->data['episodeType'] = (string) $type;
+
+        return $this->data['episodeType'];
+    }
+
+    /**
+     * Is the episode closed captioned?
+     *
+     * Returns true only if itunes:isClosedCaptioned has the value 'Yes'.
+     *
+     * @return bool
+     */
+    public function isClosedCaptioned()
+    {
+        if (isset($this->data['isClosedCaptioned'])) {
+            return $this->data['isClosedCaptioned'];
+        }
+
+        $status = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:isClosedCaptioned)');
+
+        $this->data['isClosedCaptioned'] = $status === 'Yes';
+
+        return $this->data['isClosedCaptioned'];
+    }
+
+    /**
+     * Get the season number
+     *
+     * @return null|int
+     */
+    public function getSeason()
+    {
+        if (isset($this->data['season'])) {
+            return $this->data['season'];
+        }
+
+        $season = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:season)');
+
+        if (! $season) {
+            $season = null;
+        }
+
+        $this->data['season'] = null === $season ? $season : (int) $season;
+
+        return $this->data['season'];
+    }
+
     /**
      * Register iTunes namespace
      *