Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @Entity
- * @Traits({"B", "C"})
- */
- class A
- {
- /** @Id @Column(type="integer") @GeneratedValue */
- public $id;
- }
- /** @Trait */
- abstract class B
- {
- /** @Column(type="string") */
- public $traitProperty1;
- }
- /** @Trait */
- abstract class C
- {
- /** @Column(type="string") */
- public $traitProperty12;
- }
- // Then when you run code generation you end up with something like this:
- /**
- * @Entity
- * @Traits({"B", "C"})
- */
- class A extends BaseA
- {
- /** @Id @Column(type="integer") @GeneratedValue */
- public $id;
- /** @Column(type="string") */
- public $traitProperty1;
- /** @Column(type="string") */
- public $traitProperty12;
- }
- class BaseA
- {
- public $id;
- public $traitProperty1;
- public $traitProperty12;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement