/**
  * {@inheritdoc}
  */
 public function getZboziLink()
 {
     $isbn = $this->recordDriver->getISBNs()[0];
     if (!$isbn) {
         return false;
     }
     $url = 'http://www.zbozi.cz/api/v1/search';
     $params = array('groupByCategory' => 1, 'loadTopProducts' => 'true', 'page' => 1, 'query' => str_replace("-", "", $isbn));
     $dataArray = $this->getRequestDataResponseAsArray($url, $params);
     $link = '';
     if (isset($dataArray['status']) && $dataArray['status'] === 200) {
         if (isset($dataArray['productsGroupedByCategories'][0]['products'][0]['normalizedName']) && $dataArray['productsGroupedByCategories'][0]['products'][0]['normalizedName'] !== '') {
             $link = 'http://www.zbozi.cz/vyrobek/' . $dataArray['productsGroupedByCategories'][0]['products'][0]['normalizedName'] . '/';
         }
     }
     return $link;
 }
Example #2
0
 /**
  * Return an XML representation of the record using the specified format.
  * Return false if the format is unsupported.
  *
  * @param string     $format     Name of format to use (corresponds with OAI-PMH
  * metadataPrefix parameter).
  * @param string     $baseUrl    Base URL of host containing VuFind (optional;
  * may be used to inject record URLs into XML when appropriate).
  * @param RecordLink $recordLink Record link helper (optional; may be used to
  * inject record URLs into XML when appropriate).
  *
  * @return mixed         XML, or false if format unsupported.
  */
 public function getXML($format, $baseUrl = null, $recordLink = null)
 {
     // Special case for Dublin Core:
     if ($format == 'oai_dc') {
         $fullrecord = $this->fields['fullrecord'];
         return $fullrecord;
     }
     // Try the parent method:
     return parent::getXML($format, $baseUrl, $recordLink);
 }