Skip to content
Code-Schnipsel Gruppen Projekte
Commit 3afff757 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: articles now own the gtin of the products

Übergeordneter 8f80a5c4
No related branches found
No related tags found
1 Merge Request!5refactor: articles now own the gtin of the products
......@@ -146,6 +146,7 @@ public function __construct($attributes = [])
$defaults = [
'id',
'articleNo',
'gtin',
'title',
'description',
'unitPrice',
......@@ -265,6 +266,20 @@ public function getArticleNo()
return '';
}
/**
* Return the GTIN Number, if the article has one
*
* @return string
*/
public function getGTIN(): string
{
if (isset($this->attributes['gtin'])) {
return $this->attributes['gtin'];
}
return '';
}
/**
* Returns the article title
*
......@@ -686,6 +701,7 @@ public function toArray(): array
'id' => $this->getId(),
'title' => $this->getTitle(),
'articleNo' => $this->getArticleNo(),
'gtin' => $this->getGTIN(),
'description' => $this->getDescription(),
'unitPrice' => $this->getUnitPrice()->value(),
'displayPrice' => $this->displayPrice(),
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren