Просмотр исходного кода

Fixes #324 - SlideShare API change some tag names

Frank Brückner 11 лет назад
Родитель
Сommit
4b8199a328
2 измененных файлов с 38 добавлено и 8 удалено
  1. 5 3
      library/Zend/Service/SlideShare.php
  2. 33 5
      library/Zend/Service/SlideShare/SlideShow.php

+ 5 - 3
library/Zend/Service/SlideShare.php

@@ -624,6 +624,8 @@ class Zend_Service_SlideShare
      * Converts a SimpleXMLElement object representing a response from the service
      * into a Zend_Service_SlideShare_SlideShow object
      *
+     * @see http://www.slideshare.net/developers/documentation#get_slideshow
+     *
      * @param SimpleXMLElement $node The input XML from the slideshare.net service
      * @return Zend_Service_SlideShare_SlideShow The resulting object
      * @throws Zend_Service_SlideShare_Exception
@@ -636,9 +638,9 @@ class Zend_Service_SlideShare
 
             $ss->setId((string)$node->ID);
             $ss->setDescription((string)$node->Description);
-            $ss->setEmbedCode((string)$node->EmbedCode);
+            $ss->setEmbedCode((string)$node->Embed);
             $ss->setNumViews((string)$node->Views);
-            $ss->setPermaLink((string)$node->Permalink);
+            $ss->setUrl((string)$node->URL);
             $ss->setStatus((string)$node->Status);
             $ss->setStatusDescription((string)$node->StatusDescription);
 
@@ -648,7 +650,7 @@ class Zend_Service_SlideShare
                 }
             }
 
-            $ss->setThumbnailUrl((string)$node->Thumbnail);
+            $ss->setThumbnailUrl((string)$node->ThumbnailURL);
             $ss->setTitle((string)$node->Title);
             $ss->setLocation((string)$node->Location);
             $ss->setTranscript((string)$node->Transcript);

+ 33 - 5
library/Zend/Service/SlideShare/SlideShow.php

@@ -85,11 +85,11 @@ class Zend_Service_SlideShare_SlideShow
     protected $_statusDescription;
 
     /**
-     * The Permanent link for the slide show
+     * The URL for the slide show
      *
-     * @var string the Permalink for the slide show
+     * @var string the URL for the slide show
      */
-    protected $_permalink;
+    protected $_url;
 
     /**
      * The number of views this slide show has received
@@ -393,23 +393,51 @@ class Zend_Service_SlideShare_SlideShow
     /**
      * Sets the permanent link of the slide show
      *
+     * @see Zend_Service_SlideShare_SlideShow::setUrl()
+     *
      * @param string $url The permanent URL for the slide show
      * @return Zend_Service_SlideShare_SlideShow
+     * @deprecated Since 1.12.10, use setUrl()
      */
     public function setPermaLink($url)
     {
-        $this->_permalink = (string)$url;
+        $this->setUrl($url);
         return $this;
     }
 
     /**
      * Gets the permanent link of the slide show
      *
+     * @see Zend_Service_SlideShare_SlideShow::getUrl()
+     *
      * @return string the permanent URL for the slide show
+     * @deprecated Since 1.12.10, use getUrl()
      */
     public function getPermaLink()
     {
-        return $this->_permalink;
+        return $this->getUrl();
+    }
+
+    /**
+     * Sets the URL of the slide show
+     *
+     * @param  string $url The URL for the slide show
+     * @return self
+     */
+    public function setUrl($url)
+    {
+        $this->_url = (string)$url;
+        return $this;
+    }
+
+    /**
+     * Gets the URL of the slide show
+     *
+     * @return string The URL for the slide show
+     */
+    public function getUrl()
+    {
+        return $this->_url;
     }
 
     /**