diff --git a/composer.json b/composer.json index ed19e7b..b4b9466 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "ribal/onix", + "name": "commonknowledge/onix", "description": "An ONIX 3.0 Parser", "type": "library", "license": "MIT", @@ -7,6 +7,10 @@ { "name": "Chris Ribal", "email": "c.ribal@ribal-webentwicklung.de" + }, + { + "name": "Common Knowledge", + "email": "hello@commonknowledge.coop" } ], "require": { @@ -19,4 +23,4 @@ "Ribal\\Onix\\": "src/" } } -} \ No newline at end of file +} diff --git a/src/Product/Contributor.php b/src/Product/Contributor.php index ec0bbd9..b70e33d 100644 --- a/src/Product/Contributor.php +++ b/src/Product/Contributor.php @@ -29,7 +29,7 @@ class Contributor * * @var array|NameIdentifier */ - protected $NameIdentifiers = []; + protected $NameIdentifier = []; /** * NamesBeforeKey @@ -52,6 +52,12 @@ class Contributor */ protected $KeyNames; + /** + * Website + * + * @var Website + */ + protected $Website; /** * Set SequenceNumber * @@ -80,9 +86,20 @@ public function setContributorRole(CodeList17 $ContributorRole) * @param NameIdentifier $NameIdentifier * @return void */ - public function setNameIdentifier(NameIdentifier $NameIdentifier) + public function addNameIdentifier(NameIdentifier $NameIdentifier) + { + $this->NameIdentifier[] = $NameIdentifier; + } + + /** + * Remove NameIdentifier + * + * @param NameIdentifier $NameIdentifier + * @return void + */ + public function removeNameIdentifier(NameIdentifier $NameIdentifier) { - $this->NameIdentifiers[] = $NameIdentifier; + $this->NameIdentifier[] = $NameIdentifier; } /** @@ -138,6 +155,16 @@ public function getContributorRole() return $this->ContributorRole; } + /** + * Get NameIdentifiers + * + * @return array + */ + public function getNameIdentifier() + { + return $this->NameIdentifier; + } + /** * Get NameIdentifiers * @@ -145,7 +172,7 @@ public function getContributorRole() */ public function getNameIdentifiers() { - return $this->NameIdentifiers; + return $this->NameIdentifier; } /** @@ -208,4 +235,25 @@ public function isAuthor() return $this->ContributorRole->getCode() === self::CODE_AUTHOR; } + /** + * Set Website + * + * @param Website $Website + * @return void + */ + public function setWebsite(Website $Website) + { + $this->Website = $Website; + } + + /** + * Get Website + * + * @return Website + */ + public function getWebsite() + { + return $this->Website; + } + } diff --git a/src/Product/DescriptiveDetail.php b/src/Product/DescriptiveDetail.php index 8d3880d..333e0ae 100644 --- a/src/Product/DescriptiveDetail.php +++ b/src/Product/DescriptiveDetail.php @@ -75,11 +75,11 @@ class DescriptiveDetail protected $Contributor = []; /** - * ContributorStatement + * Array of ContributorStatements * * @var string */ - protected $ContributorStatement; + protected $ContributorStatement = []; /** * EditionNumber @@ -272,14 +272,14 @@ public function removeContributor(Contributor $Contributor) } /** - * Set ContributorStatement + * Add ContributorStatement * * @param string $ContributorStatement * @return void */ - public function setContributorStatement(string $ContributorStatement) + public function addContributorStatement(string $ContributorStatement) { - $this->ContributorStatement = $ContributorStatement; + $this->ContributorStatement[] = $ContributorStatement; } /** diff --git a/src/Product/Product.php b/src/Product/Product.php index 4a61cce..a69219a 100644 --- a/src/Product/Product.php +++ b/src/Product/Product.php @@ -81,9 +81,9 @@ class Product /** * ProductSupply * - * @var ProductSupply + * @var array|ProductSupply */ - protected $ProductSupply; + protected $ProductSupply = []; /** * Set the Products record reference @@ -207,14 +207,25 @@ public function setRelatedMaterial(RelatedMaterial $RelatedMaterial) } /** - * Set ProductSupply + * Add a new Product Supply * - * @param ProductSupply $ProductSupply + * @param ProductSupply $productSupply * @return void */ - public function setProductSupply(ProductSupply $ProductSupply) + public function addProductSupply(ProductSupply $productSupply) { - $this->ProductSupply = $ProductSupply; + $this->ProductSupply[] = $productSupply; + } + + /** + * Remove Product Supply + * + * @param ProductSupply $productSupply + * @return void + */ + public function removeProductSupply(ProductSupply $productSupply) + { + $this->ProductSupply[] = $productSupply; } /** @@ -317,4 +328,4 @@ public function getRecordSourceName() return $this->RecordSourceName; } -} \ No newline at end of file +} diff --git a/src/Product/ProductFormFeature.php b/src/Product/ProductFormFeature.php index 5ca8efb..d638f37 100644 --- a/src/Product/ProductFormFeature.php +++ b/src/Product/ProductFormFeature.php @@ -4,6 +4,7 @@ use Ribal\Onix\CodeList\CodeList79; use Ribal\Onix\CodeList\CodeList98; +use Ribal\Onix\CodeList\CodeList220; class ProductFormFeature { @@ -43,10 +44,10 @@ public function setProductFormFeatureType(CodeList79 $ProductFormFeatureType) /** * Set ProductFormFeatureValue * - * @param CodeList98 $ProductFormFeatureValue + * @param CodeList220 | CodeList98 $ProductFormFeatureValue * @return void */ - public function setProductFormFeatureValue(CodeList98 $ProductFormFeatureValue) + public function setProductFormFeatureValue(CodeList220 | CodeList98 $ProductFormFeatureValue) { $this->ProductFormFeatureValue = $ProductFormFeatureValue; } @@ -91,4 +92,4 @@ public function getProductFormFeatureDescription() { return $this->ProductFormFeatureDescription; } -} \ No newline at end of file +} diff --git a/src/Product/RelatedWork.php b/src/Product/RelatedWork.php index da44813..0e4d7f6 100644 --- a/src/Product/RelatedWork.php +++ b/src/Product/RelatedWork.php @@ -15,11 +15,11 @@ class RelatedWork protected $WorkRelationCode; /** - * WorkIdentifier + * Array of WorkIdentifiers * - * @var WorkIdentifier + * @var arrayWorkIdentifier */ - protected $WorkIdentifier; + protected $WorkIdentifier = []; /** * Set WorkRelationCode @@ -33,14 +33,14 @@ public function setWorkRelationCode(CodeList164 $WorkRelationCode) } /** - * Set WorkIdentifier + * Add a new WorkIdentifier * * @param WorkIdentifier $WorkIdentifier * @return void */ - public function setWorkIdentifier(WorkIdentifier $WorkIdentifier) + public function addWorkIdentifier(WorkIdentifier $WorkIdentifier) { - $this->WorkIdentifier = $WorkIdentifier; + $this->WorkIdentifier[] = $WorkIdentifier; } /** @@ -56,11 +56,21 @@ public function getWorkRelationCode() /** * WorkIdentifier * - * @return WorkIdentifier + * @return array */ public function getWorkIdentifier() { return $this->WorkIdentifier; } + /** + * Remove WorkIdentifier + * + * @param WorkIdentifier $WorkIdentifier + * @return void + */ + public function removeWorkIdentifier(WorkIdentifier $WorkIdentifier) + { + } + } \ No newline at end of file diff --git a/src/Product/Stock.php b/src/Product/Stock.php new file mode 100644 index 0000000..edfbf99 --- /dev/null +++ b/src/Product/Stock.php @@ -0,0 +1,62 @@ +LocationName = $LocationName; + } + + /** + * Get PublisherName + * + * @return string + */ + public function getLocationName() + { + return $this->LocationName; + } + + /** + * Set OnHand + * + * @param string $OnHand + * @return void + */ + public function setOnHand(int $OnHand) + { + $this->OnHand = $OnHand; + } + + /** + * Get OnHand + * + * @return string + */ + public function getOnHand() + { + return $this->OnHand; + } +} diff --git a/src/Product/SupplyDetail.php b/src/Product/SupplyDetail.php index 136a847..f663073 100644 --- a/src/Product/SupplyDetail.php +++ b/src/Product/SupplyDetail.php @@ -28,6 +28,13 @@ class SupplyDetail */ protected $ProductAvailability; + /** + * Stock + * + * @var Stock + */ + protected $Stock; + /** * PackQuantity * @@ -144,6 +151,27 @@ public function getProductAvailability() return $this->ProductAvailability; } + /** + * Get Stock + * + * @return Stock + */ + public function getStock() + { + return $this->Stock; + } + + /** + * Set Stock + * + * @param Stock $Stock + * @return void + */ + public function setStock(Stock $Stock) + { + $this->Stock = $Stock; + } + /** * Get PackQuantity * diff --git a/src/Product/TextContent.php b/src/Product/TextContent.php index 9b86bed..dc3d378 100644 --- a/src/Product/TextContent.php +++ b/src/Product/TextContent.php @@ -10,7 +10,7 @@ class TextContent { - private const CODE_MAINDESCRIPTION = '03'; + private const CODE_MAINDESCRIPTION = '03'; /** * Type of the Text @@ -33,6 +33,13 @@ class TextContent */ protected $SourceTitle; + /** + * TextAuthor + * + * @var string + */ + protected $TextAuthor; + /** * Text * @@ -73,6 +80,27 @@ public function setSourceTitle(string $SourceTitle) $this->SourceTitle = $SourceTitle; } + /** + * Set TextAuthor + * + * @param string $TextAuthor + * @return void + */ + public function setTextAuthor(string $TextAuthor) + { + $this->TextAuthor = $TextAuthor; + } + + /** + * Get TextAuthor + * + * @return string $TextAuthor + */ + public function getTextAuthor() + { + return $this->TextAuthor; + } + /** * Set Text *