1 | <?php |
||
48 | class Property implements PropertyInterface |
||
49 | { |
||
50 | /** |
||
51 | * Property name |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $name; |
||
56 | /** |
||
57 | * Vocabulary |
||
58 | * |
||
59 | * @var VocabularyInterface |
||
60 | */ |
||
61 | protected $vocabulary; |
||
62 | /** |
||
63 | * Property value |
||
64 | * |
||
65 | * @var string |
||
66 | */ |
||
67 | protected $value; |
||
68 | |||
69 | /** |
||
70 | * Property constructor |
||
71 | * |
||
72 | * @param string $name Property name |
||
73 | * @param VocabularyInterface $vocabulary Property vocabulary |
||
74 | * @param string $value Property value |
||
75 | */ |
||
76 | 3 | public function __construct($name, VocabularyInterface $vocabulary, $value) |
|
82 | |||
83 | /** |
||
84 | * Validate a property name |
||
85 | * |
||
86 | * @param string $name Property name |
||
87 | * @return string Sanitized property name |
||
88 | * @throws RuntimeException If the property name is invalid |
||
89 | */ |
||
90 | 4 | public static function validatePropertyName($name) |
|
103 | |||
104 | /** |
||
105 | * Return the property name |
||
106 | * |
||
107 | * @return string Property name |
||
108 | */ |
||
109 | 2 | public function getName() |
|
113 | |||
114 | /** |
||
115 | * Return the property vocabulary |
||
116 | * |
||
117 | * @return VocabularyInterface Property vocabulary |
||
118 | */ |
||
119 | 1 | public function getVocabulary() |
|
123 | |||
124 | /** |
||
125 | * Property value |
||
126 | * |
||
127 | * @return string Property value |
||
128 | */ |
||
129 | 1 | public function getValue() |
|
133 | } |
||
134 |