Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 9th, 2010  |  syntax: PHP  |  size: 0.66 KB  |  views: 173  |  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. <?php
  2.  
  3. /**
  4.  * @Entity
  5.  * @Traits({"B", "C"})
  6.  */
  7. class A
  8. {
  9.   /** @Id @Column(type="integer") @GeneratedValue */
  10.   public $id;
  11. }
  12.  
  13. /** @Trait */
  14. abstract class B
  15. {
  16.   /** @Column(type="string") */
  17.   public $traitProperty1;
  18. }
  19.  
  20. /** @Trait */
  21. abstract class C
  22. {
  23.   /** @Column(type="string") */
  24.   public $traitProperty12;
  25. }
  26.  
  27. // Then when you run code generation you end up with something like this:
  28.  
  29. /**
  30.  * @Entity
  31.  * @Traits({"B", "C"})
  32.  */
  33. class A
  34. {
  35.   /** @Id @Column(type="integer") @GeneratedValue */
  36.   public $id;
  37.  
  38.   /** @Column(type="string") */
  39.   public $traitProperty1;
  40.  
  41.   /** @Column(type="string") */
  42.   public $traitProperty12;
  43. }
clone this paste RAW Paste Data