| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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() |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Extract and format data needed for the Identifiers Relationship |
||
| 25 | * on the Publication Model. |
||
| 26 | */ |
||
| 27 | public function extractIdentifiersData(): void |
||
| 28 | { |
||
| 29 | $pubmed = stringify($this->crawler->evaluate('string(//input[@id="absid"]/@value)')); |
||
| 30 | |||
| 31 | if (! empty($pubmed)) { |
||
| 32 | $this->resourceOutput['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(): void |
||
| 50 | ]; |
||
| 51 | } |
||
| 54 |