Ejemplo n.º 1
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $bookingElement = $dom->createElement('bookingperiod');
     $bookingElement->appendChild($dom->createElement('datefrom', date('Y-m-d', $this->dateFrom)));
     $bookingElement->appendChild($dom->createElement('dateto', date('Y-m-d', $this->dateTill)));
     $element->appendChild($bookingElement);
 }
Ejemplo n.º 2
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $exceptionsElement = $dom->createElement('exceptions');
     foreach ($this as $timestamp) {
         $timestamp->appendToDom($exceptionsElement);
     }
     $element->appendChild($exceptionsElement);
 }
Ejemplo n.º 3
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $openingElement = $dom->createElement('openingtime');
     $openingElement->setAttribute('from', $this->openFrom);
     if ($this->openTill) {
         $openingElement->setAttribute('to', $this->openTill);
     }
     $element->appendChild($openingElement);
 }
Ejemplo n.º 4
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $schemeElement = $dom->createElement('weekscheme');
     foreach ($this->days as $day) {
         if ($day) {
             $day->appendToDom($schemeElement);
         }
     }
     $element->appendChild($schemeElement);
 }
Ejemplo n.º 5
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $organiserElement = $dom->createElement('organiser');
     if ($this->label) {
         $labelElement = $dom->createElement('label');
         $labelElement->appendChild($dom->createTextNode($this->label));
         if ($this->cdbid) {
             $labelElement->setAttribute('cdbid', $this->cdbid);
         }
         $organiserElement->appendChild($labelElement);
     }
     $element->appendChild($organiserElement);
 }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $priceElement = $dom->createElement('price');
     if (isset($this->title)) {
         $titleElement = $dom->createElement('title');
         $titleElement->appendChild($dom->createTextNode($this->title));
         $priceElement->appendChild($titleElement);
     }
     if (isset($this->value)) {
         $valueElement = $dom->createElement('pricevalue');
         $valueElement->appendChild($dom->createTextNode($this->value));
         $priceElement->appendChild($valueElement);
     }
     if ($this->description) {
         $descriptionElement = $dom->createElement('pricedescription');
         $descriptionElement->appendChild($dom->createTextNode($this->description));
         $priceElement->appendChild($descriptionElement);
     }
     $element->appendChild($priceElement);
 }
Ejemplo n.º 8
0
Archivo: Url.php Proyecto: RustiSub/Cdb
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $urlElement = $dom->createElement('url');
     $urlElement->appendChild($dom->createTextNode($this->url));
     if ($this->main) {
         $urlElement->setAttribute('main', 'true');
     }
     if ($this->reservation) {
         $urlElement->setAttribute('reservation', 'true');
     }
     $element->appendChild($urlElement);
 }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $addressElement = $dom->createElement('address');
     $element->appendChild($addressElement);
     if ($this->physicalAddress) {
         $this->physicalAddress->appendToDOM($addressElement);
     }
     if ($this->virtualAddress) {
         $this->virtualAddress->appendToDOM($addressElement);
     }
 }
Ejemplo n.º 11
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $timestampElement = $dom->createElement('timestamp');
     if ($this->openType) {
         $timestampElement->setAttribute('opentype', $this->openType);
     }
     $dateElement = $dom->createElement('date', $this->date);
     $timestampElement->appendChild($dateElement);
     if ($this->startTime) {
         $timeStartElement = $dom->createElement('timestart', $this->startTime);
         $timestampElement->appendChild($timeStartElement);
     }
     if ($this->endTime) {
         $timeEndElement = $dom->createElement('timeend');
         $timeEndElement->appendChild($dom->createTextNode($this->endTime));
         $timestampElement->appendChild($timeEndElement);
     }
     $element->appendChild($timestampElement);
 }
Ejemplo n.º 12
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $dayElement = $dom->createElement($this->dayName);
     if ($this->openType) {
         $dayElement->setAttribute('opentype', $this->openType);
     }
     foreach ($this->openingTimes as $openingTime) {
         $openingTime->appendToDOM($dayElement);
     }
     $element->appendChild($dayElement);
 }
Ejemplo n.º 13
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $locationElement = $dom->createElement('location');
     if ($this->address) {
         $this->address->appendToDOM($locationElement);
     }
     if ($this->label) {
         $labelElement = $dom->createElement('label');
         $labelElement->appendChild($dom->createTextNode($this->label));
         if ($this->cdbid) {
             $labelElement->setAttribute('cdbid', $this->cdbid);
         }
         $locationElement->appendChild($labelElement);
     }
     if ($this->actor) {
         $this->actor->appendToDOM($locationElement);
     }
     $element->appendChild($locationElement);
 }
Ejemplo n.º 14
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $mailElement = $dom->createElement('mail', $this->address);
     if ($this->main) {
         $mailElement->setAttribute('main', 'true');
     }
     if ($this->reservation) {
         $mailElement->setAttribute('reservation', 'true');
     }
     $element->appendChild($mailElement);
 }
Ejemplo n.º 15
0
 /**
  * @see CultureFeed_Cdb_IElement::appendToDOM()
  */
 public function appendToDOM(DOMELement $element)
 {
     $dom = $element->ownerDocument;
     $phoneElement = $dom->createElement('phone', $this->number);
     if ($this->type) {
         $phoneElement->setAttribute('type', $this->type);
     }
     if ($this->main) {
         $phoneElement->setAttribute('main', 'true');
     }
     if ($this->reservation) {
         $phoneElement->setAttribute('reservation', 'true');
     }
     $element->appendChild($phoneElement);
 }
Ejemplo n.º 16
0
 /**
  * Sets the properties to the defined element
  * @param array      $original_properties
  * @param array      $properties
  * @param DOMELement $element
  */
 private function set_properties($original_properties, $properties, &$element)
 {
     // add new properties into the list
     foreach ($original_properties as $key => $value) {
         $properties[$key] = $value;
     }
     // build string
     $property_chunks = [];
     // build chunks
     foreach ($properties as $key => $values) {
         foreach ($values as $value) {
             $property_chunks[] = $key . ': ' . $value . ';';
         }
     }
     // build properties string
     $properties_string = implode(' ', $property_chunks);
     // set attribute
     if (!empty($properties_string)) {
         $element->setAttribute('style', $properties_string);
     }
 }