Skip to content

Commit

Permalink
BPI-158 - Adapt for recent BPI service asset related changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
OIOIOOOI committed Nov 14, 2019
1 parent 7f090e1 commit ee71fe1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Bpi/Sdk/Item/Node.php
Expand Up @@ -23,17 +23,17 @@ public function getAssets()
if (!$this->assets) {
$assets = array();

foreach ($this->element->xpath('assets/file') as $asset) {
$type = (string)$asset['type'];
if (!isset($assets[$type])) {
$assets[$type] = array();
}
foreach ($this->element->xpath('//property[@type="asset"]') as $asset) {
$nameAttribute = (string) $asset['name'];
$tagValue = (string) $asset;

// Convert attributes to associative array.
$properties = array();
foreach ($asset->attributes() as $name => $value) {
$properties[$name] = (string)$value;
}
$assets[$type][] = $properties;
$properties['path'] = $tagValue;
$assets[$nameAttribute][] = $properties;
}

$this->assets = $assets;
Expand Down

0 comments on commit ee71fe1

Please sign in to comment.