Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
BaseAnnotationTrait.php
Go to the documentation of this file.
1
<?php
2
namespace
Ubiquity\annotations
;
3
4
use Ubiquity\utils\base\UArray;
5
13
class
BaseAnnotationTrait
{
14
abstract
protected
function
getDefaultParameters
(): array;
15
16
public
function
getProperties
() {
17
$reflect = new \ReflectionClass ( $this );
18
$props = $reflect->getProperties ();
19
return
$props;
20
}
21
22
public
function
getPropertiesAndValues
($props = NULL) {
23
$ret = [];
24
$defaultParameters=$this->
getDefaultParameters
();
25
if
(\is_null ( $props ))
26
$props = $this->
getProperties
();
27
foreach
( $props as $prop ) {
28
$prop->setAccessible (
true
);
29
$name=$prop->getName();
30
$v = $prop->getValue ( $this );
31
if
($v !==
null
&& $v !==
''
&& isset ( $v )) {
32
if
(!isset($defaultParameters[$name]) || $defaultParameters[$name]!==$v){
33
$ret [$name] = $v;
34
}
35
}
36
}
37
return
$ret;
38
}
39
40
public
function
isSameAs
($annot):bool{
41
return \get_class($this)===\get_class($annot);
42
}
43
}
44
Ubiquity\annotations\BaseAnnotationTrait
Ubiquity\annotations$BaseAnnotationTrait This class is part of Ubiquity.
Definition
BaseAnnotationTrait.php:13
Ubiquity\annotations\BaseAnnotationTrait\isSameAs
isSameAs($annot)
Definition
BaseAnnotationTrait.php:40
Ubiquity\annotations\BaseAnnotationTrait\getPropertiesAndValues
getPropertiesAndValues($props=NULL)
Definition
BaseAnnotationTrait.php:22
Ubiquity\annotations\BaseAnnotationTrait\getProperties
getProperties()
Definition
BaseAnnotationTrait.php:16
Ubiquity\annotations\BaseAnnotationTrait\getDefaultParameters
getDefaultParameters()
Ubiquity\annotations
Definition
AnnotationsEngine.php:2
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
annotations
BaseAnnotationTrait.php
Generated on Sun Dec 10 2023 15:04:11 for
Ubiquity
by
doxygen
1.9.8