Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class PubmedWebsite extends Extractor implements ProvidesIdentifiersData, ProvidesAffiliationsData |
||
8 | { |
||
9 | /** |
||
10 | * @var Crawler |
||
11 | */ |
||
12 | protected $crawler; |
||
13 | |||
14 | /** |
||
15 | * Create search tree. |
||
16 | */ |
||
17 | protected function getDataFromDocument() |
||
18 | { |
||
19 | $this->crawler = new Crawler(); |
||
20 | $this->crawler->addHtmlContent($this->document); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Extract and format data needed for the Identifiers Relationship |
||
25 | * on the Publication Model. |
||
26 | */ |
||
27 | public function extractIdentifiersData() |
||
28 | { |
||
29 | $pubmed = stringify($this->crawler->evaluate('string(//input[@id="absid"]/@value)')); |
||
30 | |||
31 | if (! empty($pubmed)) { |
||
32 | $this->output['identifiers'][] = [ |
||
33 | 'value' => $pubmed, |
||
34 | 'type' => 'pubmed', |
||
35 | ]; |
||
36 | } |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Extract and format data needed for the Affiliations Relationship |
||
41 | * on the Publication Model. |
||
42 | */ |
||
43 | public function extractAffiliationsData() |
||
50 | ]; |
||
51 | } |
||
52 | } |
||
54 |