Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use DoctrineCommonCollectionsArrayCollection;
- use DoctrineORMMappingColumn;
- use DoctrineORMMappingTable;
- use DoctrineORMMappingEntity;
- use DoctrineORMMappingId;
- use DoctrineORMMappingGeneratedValue;
- use DoctrineORMMappingManyToOne;
- use DoctrineORMMappingOneToMany;
- use DoctrineORMMappingJoinColumn;
- use JMSSerializerAnnotation as JMS;
- /**
- * Document
- *
- * @Table(name="document")
- * @Entity(repositoryClass="AcmeBundleDocumentRepository")
- */
- class Document
- {
- /**
- * @var string
- *
- * @Column(name="id", type="string")
- * @Id
- * @GeneratedValue(strategy="UUID")
- */
- protected $id;
- /**
- * @var string
- * @Column(name="name", type="string", length=255)
- */
- protected $name;
- /**
- * @var string
- * @Column(name="type", type="string", length=255)
- */
- protected $type;
- /**
- * @var boolean
- * @Column(name="has_attachments", type="boolean")
- */
- protected $hasAttachments;
- /**
- * @ManyToOne(targetEntity="Delivery")
- * @JoinColumn(name="delivery_id", referencedColumnName="id", nullable=false)
- * @JMSExclude()
- */
- protected $delivery;
- /**
- * @OneToMany(targetEntity="Extension", mappedBy="document", cascade={"persist","remove"})
- **/
- protected $extensions;
- public function __construct()
- {
- $this->extensions = new ArrayCollection();
- }
- /* getter and setters */
- }
- use DoctrineORMMappingTable;
- use DoctrineORMMappingEntity;
- /**
- * Note
- *
- * @Table(name="note")
- * @Entity(repositoryClass="NoteRepository")
- */
- class Note extends Document
- {
- }
- /**
- * @MappedSuperclass
- */
- class DocumentSuperClass
- {
- ...
- }
- /**
- * @Table(name="document")
- * @Entity(repositoryClass="AcmeBundleDocumentRepository")
- */
- class Document extends DocumentSuperClass
- {
- ...
- }
- /**
- * @Table(name="note")
- * @Entity(repositoryClass="NoteRepository")
- */
- class Note extends DocumentSuperClass
- {
- ...
- }
Add Comment
Please, Sign In to add comment