Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "ribal/onix",
"name": "commonknowledge/onix",
"description": "An ONIX 3.0 Parser",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Chris Ribal",
"email": "[email protected]"
},
{
"name": "Common Knowledge",
"email": "[email protected]"
}
],
"require": {
Expand All @@ -19,4 +23,4 @@
"Ribal\\Onix\\": "src/"
}
}
}
}
56 changes: 52 additions & 4 deletions src/Product/Contributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Contributor
*
* @var array|NameIdentifier
*/
protected $NameIdentifiers = [];
protected $NameIdentifier = [];

/**
* NamesBeforeKey
Expand All @@ -52,6 +52,12 @@ class Contributor
*/
protected $KeyNames;

/**
* Website
*
* @var Website
*/
protected $Website;
/**
* Set SequenceNumber
*
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -138,14 +155,24 @@ public function getContributorRole()
return $this->ContributorRole;
}

/**
* Get NameIdentifiers
*
* @return array
*/
public function getNameIdentifier()
{
return $this->NameIdentifier;
}

/**
* Get NameIdentifiers
*
* @return array
*/
public function getNameIdentifiers()
{
return $this->NameIdentifiers;
return $this->NameIdentifier;
}

/**
Expand Down Expand Up @@ -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;
}

}
10 changes: 5 additions & 5 deletions src/Product/DescriptiveDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class DescriptiveDetail
protected $Contributor = [];

/**
* ContributorStatement
* Array of ContributorStatements
*
* @var string
*/
protected $ContributorStatement;
protected $ContributorStatement = [];

/**
* EditionNumber
Expand Down Expand Up @@ -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;
}

/**
Expand Down
25 changes: 18 additions & 7 deletions src/Product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class Product
/**
* ProductSupply
*
* @var ProductSupply
* @var array|ProductSupply
*/
protected $ProductSupply;
protected $ProductSupply = [];

/**
* Set the Products record reference
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -317,4 +328,4 @@ public function getRecordSourceName()
return $this->RecordSourceName;
}

}
}
7 changes: 4 additions & 3 deletions src/Product/ProductFormFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Ribal\Onix\CodeList\CodeList79;
use Ribal\Onix\CodeList\CodeList98;
use Ribal\Onix\CodeList\CodeList220;

class ProductFormFeature
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -91,4 +92,4 @@ public function getProductFormFeatureDescription()
{
return $this->ProductFormFeatureDescription;
}
}
}
24 changes: 17 additions & 7 deletions src/Product/RelatedWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class RelatedWork
protected $WorkRelationCode;

/**
* WorkIdentifier
* Array of WorkIdentifiers
*
* @var WorkIdentifier
* @var arrayWorkIdentifier
*/
protected $WorkIdentifier;
protected $WorkIdentifier = [];

/**
* Set WorkRelationCode
Expand All @@ -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;
}

/**
Expand All @@ -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)
{
}

}
62 changes: 62 additions & 0 deletions src/Product/Stock.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace Ribal\Onix\Product;

class Stock
{
/**
* LocationName
*
* @var string
*/
protected $LocationName;

/**
* OnHand
*
* @var int
*/
protected $OnHand;

/**
* Set LocationName
*
* @param string $LocationName
* @return void
*/
public function setLocationName(string $LocationName)
{
$this->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;
}
}
28 changes: 28 additions & 0 deletions src/Product/SupplyDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class SupplyDetail
*/
protected $ProductAvailability;

/**
* Stock
*
* @var Stock
*/
protected $Stock;

/**
* PackQuantity
*
Expand Down Expand Up @@ -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
*
Expand Down
Loading