Open Journal Systems  3.3.0
Term.php
1 <?php
11 namespace Seboettg\CiteProc\Locale;
12 
13 use InvalidArgumentException;
14 
21 class Term
22 {
23 
24  private $name = "";
25 
26  private $form = "long";
27 
28  private $single = "";
29 
30  private $multiple = "";
31 
32  private $match = "";
33 
34  private $genderForm = "";
35 
36  private $gender = "";
37 
38  public function __set($name, $value)
39  {
40  $nameParts = explode("-", $name);
41  $attr = "";
42  for ($i = count($nameParts) - 1; $i >= 0; --$i) {
43  if ($i > 0) {
44  $attr = ucfirst($nameParts[$i]) . $attr;
45  } else {
46  $attr = $nameParts[$i] . $attr;
47  }
48  }
49  if (!isset($this->{$attr})) {
50  throw new InvalidArgumentException("Property \"$attr\" ($name) does not exist in " . __CLASS__);
51  }
52  $this->{$attr} = $value;
53  }
54 
55  public function __get($name)
56  {
57  return $this->{$name};
58  }
59 
63  public function getName()
64  {
65  return $this->name;
66  }
67 }
Seboettg\CiteProc\Locale\Term\getName
getName()
Definition: Term.php:63
Seboettg\CiteProc\Locale\Term\__get
__get($name)
Definition: Term.php:55
Seboettg\CiteProc\Locale\Term\__set
__set($name, $value)
Definition: Term.php:38
Seboettg\CiteProc\Locale
Definition: Locale.php:10
Seboettg\CiteProc\Locale\Term
Definition: Term.php:21