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

Merge branch 'dev' into 'master'

refactor: articles now own the gtin of the products

See merge request !5
Übergeordnete b1cf5cd2 3afff757
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!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% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren