Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Jun 8, 2020
2 parents 2a7b044 + a267f74 commit 67934ec
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Object/ResourceObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(array $data, $config, string $language = 'en')

/**
* get the data based on the property
*
*
* @param string $property
* @return array
*/
Expand All @@ -61,7 +61,7 @@ private function setData(string $prop = null, array $v = null)

/**
* Get the Resource title
*
*
* @return string
*/
public function getTitle(): string
Expand All @@ -81,16 +81,16 @@ public function getIdentifiers(): array

/**
* Get all identifiers which are not acdh related
*
*
* @return type
*/
public function getNonAcdhIdentifiers()
{
$result = array();
if(isset($this->properties["acdh:hasIdentifier"]) && !empty($this->properties["acdh:hasIdentifier"])) {
foreach($this->properties["acdh:hasIdentifier"] as $k => $v) {
//filter out the baseurl related identifiers and which contains the id.acdh
if ( (strpos($v->value, $this->config->getBaseUrl()) === false) &&
if (isset($this->properties["acdh:hasIdentifier"]) && !empty($this->properties["acdh:hasIdentifier"])) {
foreach ($this->properties["acdh:hasIdentifier"] as $k => $v) {
//filter out the baseurl related identifiers and which contains the id.acdh
if ((strpos($v->value, $this->config->getBaseUrl()) === false) &&
(strpos($v->value, 'https://id.acdh.oeaw.ac.at') === false)
) {
$result[] = $v;
Expand Down Expand Up @@ -295,12 +295,13 @@ public function getExpertTableData(): array

/**
* Format the date values for the twig template
*
*
* @param string $property
* @param string $dateFormat
* @return string
*/
public function getFormattedDateByProperty(string $property, string $dateFormat = 'Y') : string {
public function getFormattedDateByProperty(string $property, string $dateFormat = 'Y') : string
{
if (isset($this->properties[$property])) {
if (isset($this->properties[$property][0]->value)) {
$val = strtotime($this->properties[$property][0]->value);
Expand Down

0 comments on commit 67934ec

Please sign in to comment.