Development

Changeset 1469

You must first sign up to be able to contribute.

Changeset 1469

Show
Ignore:
Timestamp:
06/16/06 17:32:04 (2 years ago)
Author:
fabien
Message:

fixed sfFeed addItemFromArray() problem (closes #520)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfFeed/lib/sfFeed.class.php

    r1400 r1469  
    9595    $item = new sfFeedItem(); 
    9696 
    97     $item->setItemTitle(isset($item_array['title']) ? $item_array['title'] : ''); 
    98     $item->setItemLink(isset($item_array['link']) ? $item_array['link'] : ''); 
    99     $item->setItemDescription(isset($item_array['description']) ? $item_array['description'] : ''); 
    100     $item->setItemAuthorEmail(isset($item_array['authorEmail']) ? $item_array['authorEmail'] : ''); 
    101     $item->setItemAuthorName(isset($item_array['authorName']) ? $item_array['authorName'] : ''); 
    102     $item->setItemAuthorLink(isset($item_array['authorLink']) ? $item_array['authorLink'] : ''); 
    103     $item->setItemPubdate(isset($item_array['pubdate']) ? $item_array['pubdate'] : ''); 
    104     $item->setItemComments(isset($item_array['comments']) ? $item_array['comments'] : ''); 
    105     $item->setItemUniqueId(isset($item_array['uniqueId']) ? $item_array['uniqueId'] : ''); 
    106     $item->setItemEnclosure(isset($item_array['enclosure']) ? $item_array['enclosure'] : ''); 
    107     $item->setItemCategories(isset($item_array['categories']) ? $item_array['categories'] : ''); 
     97    $item->setTitle(isset($item_array['title']) ? $item_array['title'] : ''); 
     98    $item->setLink(isset($item_array['link']) ? $item_array['link'] : ''); 
     99    $item->setDescription(isset($item_array['description']) ? $item_array['description'] : ''); 
     100    $item->setAuthorEmail(isset($item_array['authorEmail']) ? $item_array['authorEmail'] : ''); 
     101    $item->setAuthorName(isset($item_array['authorName']) ? $item_array['authorName'] : ''); 
     102    $item->setAuthorLink(isset($item_array['authorLink']) ? $item_array['authorLink'] : ''); 
     103    $item->setPubdate(isset($item_array['pubdate']) ? $item_array['pubdate'] : ''); 
     104    $item->setComments(isset($item_array['comments']) ? $item_array['comments'] : ''); 
     105    $item->setUniqueId(isset($item_array['uniqueId']) ? $item_array['uniqueId'] : ''); 
     106    $item->setEnclosure(isset($item_array['enclosure']) ? $item_array['enclosure'] : ''); 
     107    $item->setCategories(isset($item_array['categories']) ? $item_array['categories'] : ''); 
    108108 
    109109    $this->items[] = $item; 
     
    312312  public function getItemFeedUniqueId ($item) 
    313313  { 
    314     foreach (array('getFeedUniqueId', 'getId') as $methodName) 
     314    foreach (array('getFeedUniqueId', 'getUniqueId', 'getId') as $methodName) 
    315315    { 
    316316      if (method_exists($item, $methodName)) 
     
    426426  public function getItemFeedCategories ($item) 
    427427  { 
    428     foreach (array('getFeedCategories') as $methodName) 
    429     { 
    430       if (method_exists($item, $methodName)) 
    431       { 
    432         return $item->$methodName(); 
    433       } 
    434     } 
    435  
    436     // categories as an object 
    437     foreach (array('getCategories') as $methodName) 
     428    foreach (array('getFeedCategories', 'getCategories') as $methodName) 
    438429    { 
    439430      if (method_exists($item, $methodName) && is_object($item->$methodName())) 
    440431      { 
     432        // categories as an object 
    441433        $categories = $item->$methodName(); 
    442434        if (is_array($categories)) 
     
    451443        } 
    452444      } 
     445      else 
     446      { 
     447        return $item->$methodName(); 
     448      } 
    453449    } 
    454450 
  • plugins/sfFeed/lib/sfFeedItem.class.php

    r460 r1469  
    3131   $categories = array(); 
    3232 
    33   public function setFeedTitle ($title) 
     33  public function setTitle ($title) 
    3434  { 
    3535    $this->title = $title; 
    3636  } 
    3737 
    38   public function getFeedTitle () 
     38  public function getTitle () 
    3939  { 
    4040    return $this->title; 
    4141  } 
    4242 
    43   public function setFeedLink ($link) 
     43  public function setLink ($link) 
    4444  { 
    4545    $this->link = $link; 
    4646  } 
    4747 
    48   public function getFeedLink () 
     48  public function getLink () 
    4949  { 
    5050    return $this->link; 
    5151  } 
    5252 
    53   public function setFeedDescription ($description) 
     53  public function setDescription ($description) 
    5454  { 
    5555    $this->description = $description; 
    5656  } 
    5757 
    58   public function getFeedDescription () 
     58  public function getDescription () 
    5959  { 
    6060    return $this->description; 
    6161  } 
    6262 
    63   public function setFeedAuthorEmail ($authorEmail) 
     63  public function setAuthorEmail ($authorEmail) 
    6464  { 
    6565    $this->authorEmail = $authorEmail; 
    6666  } 
    6767 
    68   public function getFeedAuthorEmail () 
     68  public function getAuthorEmail () 
    6969  { 
    7070    return $this->authorEmail; 
    7171  } 
    7272 
    73   public function setFeedAuthorName ($authorName) 
     73  public function setAuthorName ($authorName) 
    7474  { 
    7575    $this->authorName = $authorName; 
    7676  } 
    7777 
    78   public function getFeedAuthorName () 
     78  public function getAuthorName () 
    7979  { 
    8080    return $this->authorName; 
    8181  } 
    8282 
    83   public function setFeedAuthorLink ($authorLink) 
     83  public function setAuthorLink ($authorLink) 
    8484  { 
    8585    $this->authorLink = $authorLink; 
    8686  } 
    8787 
    88   public function getFeedAuthorLink () 
     88  public function getAuthorLink () 
    8989  { 
    9090    return $this->authorLink; 
    9191  } 
    9292 
    93   public function setFeedPubdate ($pubdate) 
     93  public function setPubdate ($pubdate) 
    9494  { 
    9595    $this->pubdate = $pubdate; 
    9696  } 
    9797 
    98   public function getFeedPubdate () 
     98  public function getPubdate () 
    9999  { 
    100100    return $this->pubdate; 
    101101  } 
    102102 
    103   public function setFeedComments ($comments) 
     103  public function setComments ($comments) 
    104104  { 
    105105    $this->comments = $comments; 
    106106  } 
    107107 
    108   public function getFeedComments () 
     108  public function getComments () 
    109109  { 
    110110    return $this->comments; 
    111111  } 
    112112 
    113   public function setFeedUniqueId ($uniqueId) 
     113  public function setUniqueId ($uniqueId) 
    114114  { 
    115115    $this->uniqueId = $uniqueId; 
    116116  } 
    117117 
    118   public function getFeedUniqueId () 
     118  public function getUniqueId () 
    119119  { 
    120120    return $this->uniqueId; 
    121121  } 
    122122 
    123   public function setFeedEnclosure ($enclosure) 
     123  public function setEnclosure ($enclosure) 
    124124  { 
    125125    $this->enclosure = $enclosure; 
    126126  } 
    127127 
    128   public function getFeedEnclosure () 
     128  public function getEnclosure () 
    129129  { 
    130130    return $this->enclosure; 
    131131  } 
    132132 
    133   public function setFeedCategories ($categories) 
     133  public function setCategories ($categories) 
    134134  { 
    135135    $this->categories = $categories; 
    136136  } 
    137137 
    138   public function getFeedCategories () 
     138  public function getCategories () 
    139139  { 
    140140    return $this->categories; 
  • plugins/sfFeed/package.xml

    r1409 r1469  
    1111  <active>yes</active> 
    1212 </lead> 
    13  <date>2006-06-09</date> 
     13 <date>2006-06-16</date> 
    1414 <version> 
    15    <release>1.0.6</release> 
    16    <api>1.0.0</api> 
     15   <release>1.0.7</release> 
     16   <api>1.0.1</api> 
    1717 </version> 
    1818 <stability>