Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
TransformerAnnotation.php
Go to the documentation of this file.
1<?php
3
16
17 public $name;
18
22 public function initAnnotation(array $properties) {
23 if (isset($properties[0])) {
24 $this->name = $properties[0];
25 unset($properties[0]);
26 } else if (isset($properties['name'])) {
27 $this->name = $properties['name'];
28 } else {
29 throw new \Exception('Transformer annotation must have a name');
30 }
31 }
32
33 public function isSameAs($annot): bool {
34 return \get_class($annot) === TransformerAnnotation::class && $this->name == $annot->name;
35 }
36}
initAnnotation(array $properties)
Initialize the annotation.