Advertisement
Guest User

Untitled

a guest
Sep 9th, 2010
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  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 extends BaseA
  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. }
  44.  
  45. class BaseA
  46. {
  47.   public $id;
  48.  
  49.   public $traitProperty1;
  50.  
  51.   public $traitProperty12;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement