Skip to content

Commit

Permalink
Merge branch 'develop' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukdens committed Feb 16, 2016
2 parents 4828c06 + 875c762 commit 267541b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
8 changes: 3 additions & 5 deletions lib/CultureFeed/Cdb/Data/Calendar/OpeningTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ public static function parseFromCdbXml(SimpleXMLElement $xmlElement)

$attributes = $xmlElement->attributes();
if (!isset($attributes['from'])) {
throw new CultureFeed_Cdb_ParseException(
"Required attribute 'from' is missing on openingtime"
);
$openFrom = '00:00:00';
} else {
$openFrom = (string) $attributes['from'];
}

$openFrom = (string) $attributes['from'];

$openTill = null;
if (isset($attributes['to'])) {
$openTill = (string) $attributes['to'];
Expand Down
1 change: 1 addition & 0 deletions lib/CultureFeed/Cdb/Data/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CultureFeed_Cdb_Data_Category implements CultureFeed_Cdb_IElement
*/
const CATEGORY_TYPE_TARGET_AUDIANCE = 'targetaudience';
const CATEGORY_TYPE_FLANDERS_REGION = 'flandersregion';
const CATEGORY_TYPE_UMV = 'umv';

/**
* Type of category.
Expand Down
21 changes: 16 additions & 5 deletions lib/CultureFeed/Cdb/Item/Actor.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,22 @@ public function appendToDOM(DOMElement $element, $cdbScheme = '3.2')
}

if (count($this->keywords) > 0) {
$keywordElement = $dom->createElement('keywords');
$keywordElement->appendChild(
$dom->createTextNode(implode(';', $this->keywords))
);
$actorElement->appendChild($keywordElement);
$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) {
Expand Down

0 comments on commit 267541b

Please sign in to comment.