Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. [Inherit]
  2. class ConfigAnnotation extends ReflectionAnnotation {}
  3. class DocAnnotation extends ReflectionAnnotation {}
  4.  
  5. [ConfigAnnotation("myfile.conf")]
  6. [DocAnnotation("I'm the base abstract class")]
  7. abstract class TestBase {
  8. }
  9.  
  10. class Test extends TestBase {
  11. }
  12.  
  13. // When you get the Test annotations you don't want to inherit the DocAnnotation class but you do want to get the
  14. // Config one. So some Annotations have to be applied on their children because it make sense but some not like
  15. // ConfigAnnotation
  16.  
  17.  
  18. $r = new ReflectionClass('Test');
  19. $r->getAnnotations() will return array(ConfigAnnotation);