Open Journal Systems  3.3.0
GlobalOptions.php
1 <?php
2 /*
3  * citeproc-php
4  *
5  * @link http://github.com/seboettg/citeproc-php for the source repository
6  * @copyright Copyright (c) 2017 Sebastian Böttger.
7  * @license https://opensource.org/licenses/MIT
8  */
9 
11 
12 use SimpleXMLElement;
13 
20 {
24  private $initializeWithHyphen = true;
25 
29  private $pageRangeFormat;
30 
34  private $demoteNonDroppingParticles;
35 
40  public function __construct(SimpleXMLElement $node)
41  {
43  foreach ($node->attributes() as $attribute) {
44  switch ($attribute->getName()) {
45  case 'initialize-with-hyphen':
46  $this->initializeWithHyphen = "false" === (string) $attribute ? false : true;
47  break;
48  case 'page-range-format':
49  $this->pageRangeFormat = new PageRangeFormats((string) $attribute);
50  break;
51  case 'demote-non-dropping-particle':
52  $this->demoteNonDroppingParticles = new DemoteNonDroppingParticle((string) $attribute);
53  }
54  }
55  }
56 
62  public function isInitializeWithHyphen()
63  {
64  return $this->initializeWithHyphen;
65  }
66 
74  public function getPageRangeFormat()
75  {
76  return $this->pageRangeFormat;
77  }
78 
84  {
85  return $this->demoteNonDroppingParticles;
86  }
87 }
Seboettg\CiteProc\Style\Options\GlobalOptions
Definition: GlobalOptions.php:19
Seboettg\CiteProc\Style\Options\GlobalOptions\getDemoteNonDroppingParticles
getDemoteNonDroppingParticles()
Definition: GlobalOptions.php:92
Seboettg\CiteProc\Style\Options
Definition: BibliographyOptions.php:10
Seboettg\CiteProc\Style\Options\GlobalOptions\isInitializeWithHyphen
isInitializeWithHyphen()
Definition: GlobalOptions.php:71
Seboettg\CiteProc\Style\Options\PageRangeFormats
Definition: PageRangeFormats.php:25
Seboettg\CiteProc\Style\Options\DemoteNonDroppingParticle
Definition: DemoteNonDroppingParticle.php:24
Seboettg\CiteProc\Style\Options\GlobalOptions\getPageRangeFormat
getPageRangeFormat()
Definition: GlobalOptions.php:83
Seboettg\CiteProc\Style\Options\GlobalOptions\__construct
__construct(SimpleXMLElement $node)
Definition: GlobalOptions.php:49