Author: as
Date: Mon Oct  8 17:37:45 2007
New Revision: 6394

Log:
- Fixed the method getModuleMetaData() in ezcFeedItem.
- Added some more comments.

Modified:
    trunk/Feed/src/feed.php
    trunk/Feed/src/feed_item.php
    trunk/Feed/src/interfaces/processor.php
    trunk/Feed/src/processors/rss2.php
    trunk/Feed/src/structs/item_module_data.php
    trunk/Feed/src/structs/module_data.php

Modified: trunk/Feed/src/feed.php
==============================================================================
--- trunk/Feed/src/feed.php [iso-8859-1] (original)
+++ trunk/Feed/src/feed.php [iso-8859-1] Mon Oct  8 17:37:45 2007
@@ -128,7 +128,7 @@
 class ezcFeed implements Iterator
 {
     /**
-     * A list of all supported feed types.
+     * Holds a list of all supported feed types.
      *
      * @var array(string=>string)
      */
@@ -139,7 +139,7 @@
     );
 
     /**
-     * A list of all supported feed modules.
+     * Holds a list of all supported feed modules.
      *
      * @var array(string=>string)
      */
@@ -149,7 +149,7 @@
     );
 
     /**
-     * The feed processor.
+     * Holds the feed processor.
      *
      * @var ezcFeedProcessor
      * @ignore
@@ -157,7 +157,7 @@
     protected $feedProcessor;
 
     /**
-     * The feed type.
+     * Holds the feed type.
      *
      * @var string
      * @ignore
@@ -165,7 +165,7 @@
     protected $feedType;
 
     /**
-     * The feed items to be iterated.
+     * Holds the feed items to be iterated.
      *
      * @var array(ezcFeedItem)
      * @ignore
@@ -173,7 +173,7 @@
     protected $iteratorItems = array();
 
     /**
-     * The number of feed items.
+     * Holds the number of feed items.
      *
      * @var int
      * @ignore
@@ -181,7 +181,7 @@
     protected $iteratorElementCount = 0;
 
     /**
-     * The current feed item.
+     * Holds the current feed item.
      *
      * @var int
      * @ignore

Modified: trunk/Feed/src/feed_item.php
==============================================================================
--- trunk/Feed/src/feed_item.php [iso-8859-1] (original)
+++ trunk/Feed/src/feed_item.php [iso-8859-1] Mon Oct  8 17:37:45 2007
@@ -18,12 +18,35 @@
  */
 class ezcFeedItem
 {
+    /**
+     * Holds the feed processor.
+     *
+     * @var ezcFeedProcessor
+     * @ignore
+     */
     public $feedProcessor;
 
+    /**
+     * Holds the meta data.
+     *
+     * @var array(string=>mixed)
+     * @ignore
+     */
     protected $metaData = array();
 
-    public $moduleMetaData = array();
+    /**
+     * Holds the module meta data.
+     *
+     * @var array(string=>mixed)
+     * @ignore
+     */
+    protected $moduleMetaData = array();
 
+    /**
+     * Constructs a new feed item object.
+     *
+     * @param ezcFeedProcessor $processor The processor used by the feed item
+     */
     public function __construct( $processor )
     {
         $this->feedProcessor = $processor;
@@ -137,13 +160,13 @@
         $this->moduleMetaData[$moduleName][$element] = $value;
     }
 
-    public function getModuleMetaData( $module )
+    public function getModuleMetaData( $module, $element )
     {
-        if ( isset( $this->moduleMetaData[$module] ) )
+        if ( isset( $this->moduleMetaData[$module][$element] ) )
         {
-            return $this->moduleMetaData[$module];
+            return $this->moduleMetaData[$module][$element];
         }
-        return array();
+        return null;
     }
 
     public function getMetaData( $element )

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] Mon Oct  8 17:37:45 
2007
@@ -83,11 +83,7 @@
 
     public function getModuleItemData( $moduleName, $moduleObj, $item, 
$element )
     {
-        if ( isset( $item->moduleMetaData[$moduleName][$element] ) )
-        {
-            return $item->moduleMetaData[$moduleName][$element];
-        }
-        return null;
+        return $item->getModuleMetaData( $moduleName, $element );
     }
 
     public function setModuleMetaData( $moduleName, $moduleObj, $element, 
$value )
@@ -99,7 +95,7 @@
     public function setModuleItemData( $moduleName, $moduleObj, $item, 
$element, $value )
     {
         $value = $moduleObj->prepareMetaData( $element, $value );
-        $item->moduleMetaData[$moduleName][$element] = $value;
+        $item->setModuleMetaData( $moduleName, $moduleObj, $element, $value );
     }
 
     public function getSupportedModules()

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] Mon Oct  8 17:37:45 2007
@@ -175,7 +175,7 @@
             $namespace = $moduleDescription->moduleObj->getNamespace();
             $this->generateNamespace( $prefix, $namespace );
 
-            foreach ( $item->getModuleMetaData( $moduleName ) as $element => 
$value )
+            foreach ( $item->getAllModuleMetaData( $moduleName ) as $element 
=> $value )
             {
                 $moduleDescription->moduleObj->generateItemData( $itemTag, 
$this, $element, $value );
             }

Modified: trunk/Feed/src/structs/item_module_data.php
==============================================================================
--- trunk/Feed/src/structs/item_module_data.php [iso-8859-1] (original)
+++ trunk/Feed/src/structs/item_module_data.php [iso-8859-1] Mon Oct  8 
17:37:45 2007
@@ -17,10 +17,10 @@
  */
 class ezcFeedItemModuleData
 {
-    protected $moduleName;
+    public $moduleName;
     public $moduleObj;
     protected $item;
-    
+
     public function __construct( $moduleName, $moduleObj, $item )
     {
         $this->moduleName = $moduleName;

Modified: trunk/Feed/src/structs/module_data.php
==============================================================================
--- trunk/Feed/src/structs/module_data.php [iso-8859-1] (original)
+++ trunk/Feed/src/structs/module_data.php [iso-8859-1] Mon Oct  8 17:37:45 2007
@@ -17,7 +17,7 @@
  */
 class ezcFeedModuleData
 {
-    protected $moduleName;
+    public $moduleName;
     public $moduleObj;
     protected $feedProcessor;
     


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

Reply via email to