Skip to content

Commit

Permalink
Merge pull request #27 from kdambekalns/bugfix/26-getCopyrightNotice-…
Browse files Browse the repository at this point in the history
…check

BUGFIX: Check for getCopyrightNotice() method before use
  • Loading branch information
kdambekalns authored Sep 27, 2019
2 parents de1b0b9 + f5efecb commit 2e179e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ enabled:
- modernize_types_casting
- multiline_comment_opening_closing
- native_function_casing
- native_function_invocation
- newline_before_semicolons_chained
- no_alias_functions
- no_alternative_syntax
Expand Down
9 changes: 6 additions & 3 deletions Classes/Domain/ExtractionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,19 @@ protected function buildAssetMetaData(Asset $asset, MetaDataCollection $metaData
$collections[] = $collectionObject->getTitle();
}

$assetDto = new Dto\Asset([
$properties = [
'Caption' => $asset->getCaption(),
'CopyrightNotice' => $asset->getCopyrightNotice(),
'Identifier' => $asset->getIdentifier(),
'Title' => $asset->getTitle(),
'FileName' => $asset->getResource()->getFilename(),
'Collections' => $collections,
'Tags' => $tags,
'AssetObject' => $asset,
]);
];
if (method_exists($asset, 'getCopyrightNotice')) {
$properties['CopyrightNotice'] = $asset->getCopyrightNotice();
}
$assetDto = new Dto\Asset($properties);
$metaDataCollection->set('asset', $assetDto);
}

Expand Down

0 comments on commit 2e179e7

Please sign in to comment.