![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/lib/internal/Customweb/Annotation/ |
<?php class Customweb_Annotation_AnnotationsCollection { private $annotations; public function __construct($annotations) { $this->annotations = $annotations; } public function hasAnnotation($class) { $class = Customweb_Annotation_Util::resolveClassName($class); return isset($this->annotations[$class]); } public function getAnnotation($class) { $class = Customweb_Annotation_Util::resolveClassName($class); return isset($this->annotations[$class]) ? end($this->annotations[$class]) : false; } public function getAnnotations() { $result = array(); foreach($this->annotations as $instances) { $result[] = end($instances); } return $result; } public function getAllAnnotations($restriction = false) { $restriction = Customweb_Annotation_Util::resolveClassName($restriction); $result = array(); foreach($this->annotations as $class => $instances) { if(!$restriction || $restriction == $class) { $result = array_merge($result, $instances); } } return $result; } }