Exemple #1
0
 /**
  * Appends the current object to the passed DOM tree.
  *
  * @param DOMElement $element
  *   The DOM tree to append to.
  * @param string $cdbScheme
  *   The cdb schema version.
  *
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMElement $element, $cdbScheme = '3.2')
 {
     $dom = $element->ownerDocument;
     $actorElement = $dom->createElement('actor');
     if ($this->cdbId) {
         $actorElement->setAttribute('cdbid', $this->cdbId);
     }
     if ($this->externalId) {
         $actorElement->setAttribute('externalid', $this->externalId);
     }
     if ($this->details) {
         $this->details->appendToDOM($actorElement);
     }
     if ($this->categories) {
         $this->categories->appendToDOM($actorElement);
     }
     if ($this->contactInfo) {
         $this->contactInfo->appendToDOM($actorElement);
     }
     if (count($this->keywords) > 0) {
         $keywordElement = $dom->createElement('keywords');
         $keywordElement->appendChild($dom->createTextNode(implode(';', $this->keywords)));
         $actorElement->appendChild($keywordElement);
     }
     if ($this->weekScheme) {
         $this->weekScheme->appendToDOM($actorElement);
     }
     $element->appendChild($actorElement);
 }
Exemple #2
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $calendarElement = $dom->createElement('calendar');
     $openingTimesElement = $dom->createElement('permanentopeningtimes');
     $permanentElement = $dom->createElement('permanent');
     if ($this->exceptions) {
         $this->exceptions->appendToDOM($permanentElement);
     }
     if ($this->weekScheme) {
         $this->weekScheme->appendToDom($permanentElement);
     }
     $openingTimesElement->appendChild($permanentElement);
     $calendarElement->appendChild($openingTimesElement);
     $element->appendChild($calendarElement);
 }
Exemple #3
0
 /**
  * Appends the current object to the passed DOM tree.
  *
  * @param DOMElement $element
  *   The DOM tree to append to.
  * @param string $cdbScheme
  *   The cdb schema version.
  *
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMElement $element, $cdbScheme = '3.2')
 {
     $dom = $element->ownerDocument;
     $actorElement = $dom->createElement('actor');
     if ($this->cdbId) {
         $actorElement->setAttribute('cdbid', $this->cdbId);
     }
     if ($this->externalId) {
         $actorElement->setAttribute('externalid', $this->externalId);
     }
     if ($this->details) {
         $this->details->appendToDOM($actorElement);
     }
     if ($this->categories) {
         $this->categories->appendToDOM($actorElement);
     }
     if ($this->contactInfo) {
         $this->contactInfo->appendToDOM($actorElement);
     }
     if ($this->createdBy) {
         $actorElement->setAttribute('createdby', $this->createdBy);
     }
     if ($this->creationDate) {
         $actorElement->setAttribute('creationdate', $this->creationDate);
     }
     if (isset($this->lastUpdated)) {
         $actorElement->setAttribute('lastupdated', $this->lastUpdated);
     }
     if (isset($this->lastUpdatedBy)) {
         $actorElement->setAttribute('lastupdatedby', $this->lastUpdatedBy);
     }
     if (count($this->keywords) > 0) {
         $keywordsElement = $dom->createElement('keywords');
         if (version_compare($cdbScheme, '3.3', '>=')) {
             foreach ($this->keywords as $keyword) {
                 $keyword->appendToDOM($keywordsElement);
             }
             $actorElement->appendChild($keywordsElement);
         } else {
             $keywords = array();
             foreach ($this->keywords as $keyword) {
                 $keywords[$keyword->getValue()] = $keyword->getValue();
             }
             $keywordsElement->appendChild($dom->createTextNode(implode(';', $keywords)));
             $actorElement->appendChild($keywordsElement);
         }
     }
     if ($this->weekScheme) {
         $this->weekScheme->appendToDOM($actorElement);
     }
     $element->appendChild($actorElement);
 }
Exemple #4
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $periodElement = $dom->createElement('period');
     $periodElement->appendChild($dom->createElement('datefrom', $this->dateFrom));
     $periodElement->appendChild($dom->createElement('dateto', $this->dateTo));
     if ($this->exceptions) {
         $this->exceptions->appendToDOM($periodElement);
     }
     if ($this->weekScheme) {
         $this->weekScheme->appendToDom($periodElement);
     }
     $element->appendChild($periodElement);
 }