Author: as
Date: Wed Oct 10 15:45:04 2007
New Revision: 6416

Log:
- Added more comments.
- Removed old commented-out code.

Modified:
    trunk/Feed/src/interfaces/node.php
    trunk/Feed/src/interfaces/processor.php
    trunk/Feed/src/processors/rss.php
    trunk/Feed/src/processors/rss2.php

Modified: trunk/Feed/src/interfaces/node.php
==============================================================================
--- trunk/Feed/src/interfaces/node.php [iso-8859-1] (original)
+++ trunk/Feed/src/interfaces/node.php [iso-8859-1] Wed Oct 10 15:45:04 2007
@@ -43,6 +43,15 @@
         $this->feedProcessor = $processor;
     }
 
+    /**
+     * Sets the meta data of node element $element to $value.
+     *
+     * @throws ezcFeedOnlyOneValueAllowedException
+     *         If $value is an array.
+     *
+     * @param string $element The name of the node element
+     * @param mixed $value The new value for $element
+     */
     public function setMetaData( $element, $value )
     {
         if ( is_array( $value ) )
@@ -57,6 +66,14 @@
         unset( $this->metaData[$element] );
     }
 
+    /**
+     * Adds $value to the array of meta data associated with the node element
+     * name $element. If $value is an array it is assigned directly to the
+     * meta data, clearing old values.
+     *
+     * @param string $element The node element name
+     * @param mixed $value The new value for $element
+     */
     public function setMetaArrayData( $element, $value )
     {
         if ( is_array( $value ) )

Modified: trunk/Feed/src/interfaces/processor.php
==============================================================================
--- trunk/Feed/src/interfaces/processor.php [iso-8859-1] (original)
+++ trunk/Feed/src/interfaces/processor.php [iso-8859-1] Wed Oct 10 15:45:04 
2007
@@ -138,6 +138,40 @@
     }
 
     /**
+     * Sets the meta data value for the element $element of the module
+     * $moduleName to $value.
+     *
+     * @param string $moduleName The type of the module
+     * @param ezcFeedModule $moduleObj The module object
+     * @param ezcFeedItem $item The feed item object
+     * @param string $element The element in the module
+     * @return mixed
+     */
+    public function setModuleMetaData( $moduleName, $moduleObj, $element, 
$value )
+    {
+        $value = $moduleObj->prepareMetaData( $element, $value );
+        $this->moduleMetaData[$moduleName][$element] = $value;
+    }
+
+    /**
+     * Returns the meta data value of the element $element from the module
+     * $moduleName.
+     *
+     * @param string $moduleName The type of the module
+     * @param ezcFeedModule $moduleObj The module object
+     * @param string $element The element in the module
+     * @return mixed
+     */
+    public function getModuleMetaData( $moduleName, $moduleObj, $element )
+    {
+        if ( isset( $this->moduleMetaData[$moduleName][$element] ) )
+        {
+            return $this->moduleMetaData[$moduleName][$element];
+        }
+        return null;
+    }
+
+    /**
      * Returns all the meta data for the module $moduleName.
      *
      * The format of the returned array is:
@@ -163,21 +197,19 @@
     }
 
     /**
-     * Returns the meta data value of the element $element from the module
-     * $moduleName.
+     * Sets the meta data value for the element $element of the module
+     * $moduleName of the item $item to $value.
      *
      * @param string $moduleName The type of the module
      * @param ezcFeedModule $moduleObj The module object
+     * @param ezcFeedItem $item The feed item object
      * @param string $element The element in the module
      * @return mixed
      */
-    public function getModuleMetaData( $moduleName, $moduleObj, $element )
-    {
-        if ( isset( $this->moduleMetaData[$moduleName][$element] ) )
-        {
-            return $this->moduleMetaData[$moduleName][$element];
-        }
-        return null;
+    public function setModuleItemData( $moduleName, $moduleObj, ezcFeedItem 
$item, $element, $value )
+    {
+        $value = $moduleObj->prepareMetaData( $element, $value );
+        $item->setModuleMetaData( $moduleName, $moduleObj, $element, $value );
     }
 
     /**
@@ -193,28 +225,6 @@
     public function getModuleItemData( $moduleName, $moduleObj, ezcFeedItem 
$item, $element )
     {
         return $item->getModuleMetaData( $moduleName, $element );
-    }
-
-    /**
-     * Sets the meta data value for the element $element of the module
-     * $moduleName to $value.
-     *
-     * @param string $moduleName The type of the module
-     * @param ezcFeedModule $moduleObj The module object
-     * @param ezcFeedItem $item The feed item object
-     * @param string $element The element in the module
-     * @return mixed
-     */
-    public function setModuleMetaData( $moduleName, $moduleObj, $element, 
$value )
-    {
-        $value = $moduleObj->prepareMetaData( $element, $value );
-        $this->moduleMetaData[$moduleName][$element] = $value;
-    }
-
-    public function setModuleItemData( $moduleName, $moduleObj, $item, 
$element, $value )
-    {
-        $value = $moduleObj->prepareMetaData( $element, $value );
-        $item->setModuleMetaData( $moduleName, $moduleObj, $element, $value );
     }
 
     /**

Modified: trunk/Feed/src/processors/rss.php
==============================================================================
--- trunk/Feed/src/processors/rss.php [iso-8859-1] (original)
+++ trunk/Feed/src/processors/rss.php [iso-8859-1] Wed Oct 10 15:45:04 2007
@@ -156,43 +156,6 @@
     }
 
     /**
-     * Creates an image element in the node $item of the XML document being
-     * generated, with the title, link and url subnodes populated with the
-     * values $title, $link and $imageUrl, respectively.
-     *
-     * @param DOMNode $item The node where to add the image element
-     * @param string $title The title of the image element
-     * @param string $link The link of the image element
-     * @param string $imageUrl The image URL of the image element
-
-    public function generateImage( DOMNode $item, $title, $link, $imageUrl, 
$description = null, $width = null, $height = null )
-    {
-        $image = $this->xml->createElement( 'image' );
-
-        $image->appendChild( $this->xml->createElement( 'title', $title ) );
-        $image->appendChild( $this->xml->createElement( 'link', $link ) );
-        $image->appendChild( $this->xml->createElement( 'url', $imageUrl ) );
-
-        if ( $description !== null )
-        {
-            $image->appendChild( $this->xml->createElement( 'description', 
$description ) );
-        }
-
-        if ( $width !== null )
-        {
-            $image->appendChild( $this->xml->createElement( 'width', $width ) 
);
-        }
-
-        if ( $height !== null )
-        {
-            $image->appendChild( $this->xml->createElement( 'height', $height 
) );
-        }
-
-        $item->appendChild( $image );
-    }
-     */
-
-    /**
      * Returns the provided $date in timestamp format.
      *
      * @param mixed $date A date

Modified: trunk/Feed/src/processors/rss2.php
==============================================================================
--- trunk/Feed/src/processors/rss2.php [iso-8859-1] (original)
+++ trunk/Feed/src/processors/rss2.php [iso-8859-1] Wed Oct 10 15:45:04 2007
@@ -396,11 +396,6 @@
                 {
                     switch ( $attribute )
                     {
-                        //case 'image':
-                        //    $this->generateImage( $this->image ); 
//$this->channel, $this->getMetaData( 'title' ), $this->getMetaData( 'link' ), 
$data,
-                                //$this->getMetaData( 'description' ), 
$this->getMetaData( 'width' ), $this->getMetaData( 'height' ) );
-                        //    break;
-
                         case 'published':
                         case 'updated':
                             $this->generateMetaData( $normalizedAttribute, 
date( 'D, d M Y H:i:s O', $data ) );


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to