Skip to content

Commit

Permalink
Add getters and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
zstein-holts committed Jun 19, 2019
1 parent 8287fb1 commit 565ee22
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 0 deletions.
138 changes: 138 additions & 0 deletions lib/AddressRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ class AddressRecord {

private $resultCodes;


private $AddressExtras;
private $AddressKey;
private $AddressLine1;
private $AddressLine2;
private $City;
private $CompanyName;
private $EmailAddress;
private $MelissaAddressKey;
private $MelissaAddressKeyBase;
private $NameFull;
private $PhoneNumber;
private $PostalCode;
private $RecordExtras;
private $RecordID;
private $Reserved;
private $State;

// Codes can be found here: http://wiki.melissadata.com/index.php?title=Result_Code_Details#Address_Object
// AS01, AS02, and AS03 are the codes that indicate no corrections are necessary
//
Expand Down Expand Up @@ -55,4 +73,124 @@ public function hasGoodAddress() {
}
return false;
}

/**
* @return array
*/
public function getResultCodes() {
return $this->resultCodes;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

}
41 changes: 41 additions & 0 deletions lib/PersonatorResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class PersonatorResult {

private $records = [];

private $TotalRecords;
private $TransmissionReference;
private $TransmissionResults;
private $Version;

public function __construct(string $resultJson) {
// Build class instance
foreach (json_decode($resultJson, true) as $key => $value) {
Expand Down Expand Up @@ -55,5 +60,41 @@ public function hasCorrections() {
}
}

/**
* @return array
*/
public function getRecords() {
return $this->records;
}

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

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

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

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



}

0 comments on commit 565ee22

Please sign in to comment.