Skip to content

Commit

Permalink
map vendor code to resource
Browse files Browse the repository at this point in the history
  • Loading branch information
jsavell committed Jul 1, 2016
1 parent c67127d commit 2449358
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/admin/classes/domain/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function getCoverageText() {
return $this->attributes['coverageText'];
}

public function getVendorCode() {
return $this->attributes['vendorCode'];
}

//returns resource objects by title
public function getResourceByTitle($title){

Expand Down
11 changes: 10 additions & 1 deletion resources/admin/classes/domain/TAMUExternalResource.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
class TAMUExternalResource implements ResourceInterface {
protected $title;
protected $titleText;
protected $vendorCode;

public function setTitleText($titleText) {
$this->titleText = $titleText;
Expand Down Expand Up @@ -29,6 +30,14 @@ public function getProviderText() {
public function getCoverageText() {
return null;
}

public function setVendorCode($vendorCode) {
$this->vendorCode = $vendorCode;
}

public function getVendorCode() {
return $this->vendorCode;
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function __construct($po) {
if ($data) {
$this->setResourceObject(new TAMUExternalResource());
$this->getResourceObject()->setTitleText($data['bib_title']);
$this->getResourceObject()->setVendorCode($data['vendor_code']);
if (!is_array($data['bib_isbn'])) {
$this->addIsbnOrIssnObject(new TAMUExternalIsbnOrIssn($data['bib_isbn']));
}
Expand Down
1 change: 1 addition & 0 deletions resources/admin/interfaces/ResourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ public function getOrderNumber();
public function getSystemNumber();
public function getProviderText();
public function getCoverageText();
public function getVendorCode();
}
?>
1 change: 1 addition & 0 deletions resources/ajax_processing/submitNewResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
$statusID = $status->getIDFromName('progress');
$remoteResourceRepo = new $config->settings->externalResourceRepoClass($externalId);
$resource->setTitleText($remoteResourceRepo->getResourceObject()->getTitleText());
$resource->setVendorCode($remoteResourceRepo->getResourceObject()->getVendorCode());

$addableIsbnOrIssns = array();
foreach ($remoteResourceRepo->getIsbnOrIssnObjects() as $isbnOrIssnObject) {
Expand Down

0 comments on commit 2449358

Please sign in to comment.