Skip to content

Commit

Permalink
Upgraded ReferenceNumber with setters/getters & codes from XML Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Jun 17, 2015
1 parent e1468a6 commit dc18b15
Showing 1 changed file with 110 additions and 3 deletions.
113 changes: 110 additions & 3 deletions src/Ups/Entity/ReferenceNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,118 @@

class ReferenceNumber implements NodeInterface
{
/**
* @deprecated
*/
public $Number;

/**
* @deprecated
*/
public $Code;

/**
* @deprecated
*/
public $Value;

/**
* @deprecated
*/
public $BarCodeIndicator;

/**
* Codes
*/
const CODE_ACCOUNTS_RECEIVABLE_CUSTOMER_ACCOUNT = 'AJ';
const CODE_APPROPRIATION_NUMBER = 'AT';
const CODE_BILL_OF_LADING_NUMBER = 'BM';
const CODE_COLLECT_ON_DEVELIVERY_COD_NUMBER = '9V';
const CODE_DEALER_ORDER_NUMBER = 'ON';
const CODE_DEPARTMENT_NUMBER = 'DP';
const CODE_FOOD_AND_DRUG_ADMINISTRATION_PRODUCT_CODE = '3Q';
const CODE_INVOICE_NUMBER = 'IK';
const CODE_MANIFEST_KEY_NUMBER = 'MK';
const CODE_MODEL_NUMBER = 'MJ';
const CODE_PART_NUMBER = 'PM';
const CODE_PRODUCTION_CODE = 'PC';
const CODE_PURCHASE_ORDER_NUMBER = 'PO';
const CODE_PURCHASE_REQUEST_NUMBER = 'RQ';
const CODE_RETURN_AUTHORIZATION_NUMBER = 'RZ';
const CODE_SALESPERSON_NUMBER = 'SA';
const CODE_SERIAL_NUMBER = 'SE';
const CODE_STORE_NUMBER = 'ST';
const CODE_TRANSACTION_REFERENCE_NUMBER = 'TN';
const CODE_EMPLOYER_ID_NUMBER = 'EI';
const CODE_FEDERAL_TAXPAYER_ID = 'TJ';
const CODE_SOCIAL_SECURITY_NUMBER = 'SY';

/**
* @var
*/
private $code;

/**
* @var
*/
private $value;

/**
* @var
*/
private $barCodeIndicator;

/**
* @return mixed
*/
public function getCode()
{
return $this->code;
}

/**
* @param mixed $code
*/
public function setCode($code)
{
$this->code = $code;
}

/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}

/**
* @param mixed $value
*/
public function setValue($value)
{
$this->value = $value;
}

/**
* @return mixed
*/
public function getBarCodeIndicator()
{
return $this->barCodeIndicator;
}

/**
* @param mixed $barCodeIndicator
*/
public function setBarCodeIndicator($barCodeIndicator)
{
$this->barCodeIndicator = $barCodeIndicator;
}

/**
* @param null $response
*/
function __construct($response = null)
{
if (null != $response) {
Expand Down Expand Up @@ -42,11 +149,11 @@ public function toNode(DOMDocument $document = null)

$node = $document->createElement('ReferenceNumber');

if($this->BarCodeIndicator) {
if($this->getBarCodeIndicator()) {
$node->appendChild($document->createElement('BarCodeIndicator'));
}
$node->appendChild($document->createElement('Code', $this->Code));
$node->appendChild($document->createElement('Value', $this->Value));
$node->appendChild($document->createElement('Code', $this->getCode()));
$node->appendChild($document->createElement('Value', $this->getValue()));

return $node;
}
Expand Down

0 comments on commit dc18b15

Please sign in to comment.