public function get($class) { $c = array(); if (class_exists($class)) { $c = array(); // Loac Class Annotations foreach ($this->reflectionService->getClassAnnotations($class) as $key => $object) { $shortName = $this->convertAnnotationName(get_class($object)); if (!isset($c[$shortName])) { $c[$shortName] = array(); } $c[$shortName][] = $object; } $schema = $this->reflectionService->getClassSchema($class); if (is_object($schema)) { if (!isset($c["repository"])) { $c["repository"] = array(new \Admin\Annotations\Repository(array("class" => $schema->getRepositoryClassName()))); } $properties = $schema->getProperties(); } else { $properties = array_flip($this->reflectionService->getClassPropertyNames($class)); } foreach ($properties as $property => $meta) { if ($property == "FLOW3_Persistence_Identifier") { continue; } $c["properties"][$property] = array(); // Load legacy Annotations like @var,... foreach ($this->reflectionService->getPropertyTagsValues($class, $property) as $shortName => $tags) { if (!isset($c["properties"][$property])) { $c["properties"][$property] = array(); } $c["properties"][$property][$shortName] = $tags; } // $c["properties"][$property]["type"] = array( // new \Admin\Annotations\Type(array( // "name" => $meta["type"], // "subtype" => $meta["elementType"], // )) // ); // Load Annotations and override legacy Annotations $annotations = $this->reflectionService->getPropertyAnnotations($class, $property); foreach ($annotations as $key => $objects) { $shortName = $this->convertAnnotationName($key); if (!isset($c["properties"][$property])) { $c["properties"][$property] = array(); } $c["properties"][$property][$shortName] = $objects; } } } return $c; }
/** * Builds the class documentation block for the specified class keeping doc comments and vital annotations * * @return string $methodDocumentation DocComment for the given method */ protected function buildClassDocumentation() { $classDocumentation = "/**\n"; $classReflection = new \TYPO3\FLOW3\Reflection\ClassReflection($this->fullOriginalClassName); $classDescription = $classReflection->getDescription(); $classDocumentation .= ' * ' . str_replace("\n", "\n * ", $classDescription) . "\n"; foreach ($this->reflectionService->getClassAnnotations($this->fullOriginalClassName) as $annotation) { $classDocumentation .= ' * ' . \TYPO3\FLOW3\Object\Proxy\Compiler::renderAnnotation($annotation) . "\n"; } $classDocumentation .= " */\n"; return $classDocumentation; }
/** * Checks if the specified class matches with the class tag filter pattern * * @param string $className Name of the class to check against * @param string $methodName Name of the method - not used here * @param string $methodDeclaringClassName Name of the class the method was originally declared in - not used here * @param mixed $pointcutQueryIdentifier Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection. * @return boolean TRUE if the class matches, otherwise FALSE */ public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier) { return $this->reflectionService->getClassAnnotations($className, $this->annotation) !== array(); }