Skip to content

Commit

Permalink
restore backward compatibility with 2.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes committed Feb 3, 2023
1 parent 710eb09 commit 483e981
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Traits/MetadataTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,28 @@ public function getMetadata() :?MetadataDataObject
{
return $this->metadata;
}


/**
* @return array
*/
public function getImages()
{
if (! empty($this->metadata->images)) {
return $this->metadata->images;
}
return [];
}

/**
* @param $index
* @return string|null
*/
public function getImageAt($index)
{
if (! empty($this->metadata->images[$index])) {
return $this->metadata->images[$index];
}
return null;
}
}

0 comments on commit 483e981

Please sign in to comment.