src/Entity/DocumentType.php line 25

Open in your IDE?
  1. <?php
  2. namespace MedBrief\MSR\Entity;
  3. use DH\Auditor\Provider\Doctrine\Auditing\Annotation as Audit;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7. * DocumentType
  8. *
  9. * @ORM\Table(name="document_type")
  10. *
  11. * @ORM\Entity
  12. *
  13. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  14. *
  15. * @Audit\Auditable
  16. *
  17. * @Audit\Security(view={"ROLE_ALLOWED_TO_AUDIT"})
  18. *
  19. * @deprecated Legacy entity that is no longer used by active upload flows
  20. * and will be removed in a future major release.
  21. */
  22. class DocumentType
  23. {
  24. /**
  25. * @var int
  26. *
  27. * @ORM\Column(name="id", type="integer")
  28. *
  29. * @ORM\Id
  30. *
  31. * @ORM\GeneratedValue(strategy="IDENTITY")
  32. */
  33. private $id;
  34. /**
  35. * @var \DateTime|null
  36. *
  37. * @ORM\Column(name="deletedAt", type="datetime", nullable=true)
  38. */
  39. private $deletedAt;
  40. /**
  41. * @var string
  42. *
  43. * @ORM\Column(name="name", type="string")
  44. */
  45. private $name;
  46. /**
  47. * @var string
  48. *
  49. * @ORM\Column(name="slug", type="string")
  50. *
  51. * @Gedmo\Slug(fields={"name"}, updatable=false, separator="_")
  52. */
  53. private $slug;
  54. /**
  55. * @var \DateTime
  56. *
  57. * @ORM\Column(name="created", type="datetime")
  58. *
  59. * @Gedmo\Timestampable(on="create")
  60. */
  61. private $created;
  62. /**
  63. * @var \DateTime
  64. *
  65. * @ORM\Column(name="updated", type="datetime")
  66. *
  67. * @Gedmo\Timestampable(on="update")
  68. */
  69. private $updated;
  70. /**
  71. * @var Document
  72. *
  73. * @ORM\ManyToOne(targetEntity="MedBrief\MSR\Entity\Document")
  74. *
  75. * @ORM\JoinColumns({
  76. *
  77. * @ORM\JoinColumn(name="document_id", referencedColumnName="id")
  78. * })
  79. */
  80. private $document;
  81. public function __construct()
  82. {
  83. trigger_error(sprintf('The class %s is deprecated and will be removed in a future major release. Use DocumentMetadata instead.', self::class), E_USER_DEPRECATED);
  84. }
  85. public function __toString()
  86. {
  87. trigger_error(sprintf('The class %s is deprecated and will be removed in a future major release. Use DocumentMetadata instead.', self::class), E_USER_DEPRECATED);
  88. return $this->getName();
  89. }
  90. /**
  91. * Get id
  92. *
  93. * @return int
  94. */
  95. public function getId()
  96. {
  97. return $this->id;
  98. }
  99. /**
  100. * Set name
  101. *
  102. * @param string $name
  103. *
  104. * @return DocumentType
  105. */
  106. public function setName($name)
  107. {
  108. $this->name = $name;
  109. return $this;
  110. }
  111. /**
  112. * Get name
  113. *
  114. * @return string
  115. */
  116. public function getName()
  117. {
  118. return $this->name;
  119. }
  120. /**
  121. * Set slug
  122. *
  123. * @param string $slug
  124. *
  125. * @return DocumentType
  126. */
  127. public function setSlug($slug)
  128. {
  129. $this->slug = $slug;
  130. return $this;
  131. }
  132. /**
  133. * Get slug
  134. *
  135. * @return string
  136. */
  137. public function getSlug()
  138. {
  139. return $this->slug;
  140. }
  141. /**
  142. * Set created
  143. *
  144. * @param \DateTime $created
  145. *
  146. * @return DocumentType
  147. */
  148. public function setCreated($created)
  149. {
  150. $this->created = $created;
  151. return $this;
  152. }
  153. /**
  154. * Get created
  155. *
  156. * @return \DateTime
  157. */
  158. public function getCreated()
  159. {
  160. return $this->created;
  161. }
  162. /**
  163. * Set updated
  164. *
  165. * @param \DateTime $updated
  166. *
  167. * @return DocumentType
  168. */
  169. public function setUpdated($updated)
  170. {
  171. $this->updated = $updated;
  172. return $this;
  173. }
  174. /**
  175. * Get updated
  176. *
  177. * @return \DateTime
  178. */
  179. public function getUpdated()
  180. {
  181. return $this->updated;
  182. }
  183. /**
  184. * Set document
  185. *
  186. * @param Document $document
  187. *
  188. * @return DocumentType
  189. */
  190. public function setDocument(?Document $document = null)
  191. {
  192. $this->document = $document;
  193. return $this;
  194. }
  195. /**
  196. * Get document
  197. *
  198. * @return Document
  199. */
  200. public function getDocument()
  201. {
  202. return $this->document;
  203. }
  204. /**
  205. * Set deletedAt
  206. *
  207. * @param \DateTime $deletedAt
  208. *
  209. * @return DocumentType
  210. */
  211. public function setDeletedAt($deletedAt)
  212. {
  213. $this->deletedAt = $deletedAt;
  214. return $this;
  215. }
  216. /**
  217. * Get deletedAt
  218. *
  219. * @return \DateTime
  220. */
  221. public function getDeletedAt()
  222. {
  223. return $this->deletedAt;
  224. }
  225. }