Example #1
0
 public function fillFromRssAttributes($aAttributes)
 {
     if (isset($aAttributes['categories'])) {
         $aTags = $aAttributes['categories'];
         $aTagInstances = TagPeer::tagInstancesForObject($this);
         $aOldTags = array();
         foreach ($aTagInstances as $oTagInstance) {
             if (!in_array($oTagInstance->getTagName(), $aTags)) {
                 $oTagInstance->delete();
             } else {
                 $aOldTags[] = $oTagInstance->getTagName();
             }
         }
         foreach ($aTags as $sTagName) {
             if (!in_array($sTagName, $aOldTags)) {
                 TagInstancePeer::newTagInstanceForObject($sTagName, $this);
             }
         }
     }
     $this->setText($aAttributes['description']);
     $this->setTitle($aAttributes['title']);
 }