Guest User

Untitled

a guest
Aug 19th, 2019
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use DoctrineORMMapping as ORM;
  2. use DoctrineORMMappingUniqueConstraint;
  3.  
  4. /**
  5. * CommonModelEntityMedia
  6. *
  7. * @Entity
  8. * @Table(name="media",
  9. * uniqueConstraints={
  10. * @UniqueConstraint(name="virtual_unique",
  11. * columns={"virtualname", "virtualfolder"})
  12. * }
  13. * indexes={
  14. * @Index(name="idx_virtual", columns={"virtualname", "virtualfolder"})
  15. * @Index(name="idx_identifier", columns={"identifier"})
  16. * }
  17. * )
  18. */
  19.  
  20. /**
  21. * @ORMEntity(repositoryClass="AppRepositoryMediaRepository")
  22. */
  23. class Media
  24. {
  25. /**
  26. * @ORMId
  27. * @ORMGeneratedValue
  28. * @ORMColumn(type="integer")
  29. */
  30. private $id;
  31.  
  32. /**
  33. * @ORMColumn(type="string", nullable=true, options={"unique": true})
  34. */
  35. private $identifier;
  36.  
  37. /**
  38. * @ORMColumn(type="string", length=255, nullable=false)
  39. */
  40. private $virtualname;
  41.  
  42. /**
  43. * @ORMColumn(type="string", length=255, nullable=true)
  44. */
  45. private $virtualfolder;
  46. }
RAW Paste Data