src/AdminBundle/Entity/ClientChangeRequest.php line 10

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table(name: 'client_change_requests')]
  6. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\ClientChangeRequestRepository::class)]
  7. class ClientChangeRequest extends BaseEntity
  8. {
  9. const PURPOSE_BADGE_PROOF_PICTURE = 1;
  10. public static $purposeList = [
  11. self::PURPOSE_BADGE_PROOF_PICTURE => 'BADGE_PROOF_PICTURE',
  12. ];
  13. const STATUS_PENDING = 1;
  14. const STATUS_APPROVED = 2;
  15. const STATUS_DECLINED = 3;
  16. const STATUS_CANCELED = 4;
  17. public static $statusList = [
  18. self::STATUS_PENDING => 'PENDING',
  19. self::STATUS_APPROVED => 'APPROVED',
  20. self::STATUS_DECLINED => 'DECLINED',
  21. self::STATUS_CANCELED => 'CANCELED',
  22. ];
  23. const TYPE_FILE = 1;
  24. const TYPE_STRING = 2;
  25. public static $typeList = [
  26. self::TYPE_FILE => 'FILE',
  27. self::TYPE_STRING => 'STRING',
  28. ];
  29. /**
  30. * @var integer
  31. */
  32. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  33. #[ORM\Id]
  34. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  35. protected $id;
  36. /**
  37. * @var \DateTime
  38. */
  39. #[ORM\Column(name: 'created_at', type: 'datetime')]
  40. protected $createdAt;
  41. /**
  42. * @var string
  43. */
  44. #[ORM\Column(name: 'purpose', type: 'integer')]
  45. protected $purpose;
  46. /**
  47. * @var string
  48. */
  49. #[ORM\Column(name: 'value', type: 'string', length: 255)]
  50. protected $value;
  51. /**
  52. * @var string
  53. */
  54. #[ORM\Column(name: '`class`', type: 'string', length: 255)]
  55. protected $class;
  56. /**
  57. * @var string
  58. */
  59. #[ORM\Column(name: 'type', type: 'integer')]
  60. protected $type;
  61. /**
  62. * @var string
  63. */
  64. #[ORM\Column(name: 'destination_id', type: 'integer', nullable: true)]
  65. protected $destinationId;
  66. /**
  67. * @var string
  68. */
  69. #[ORM\Column(name: 'destination_path', type: 'string', length: 255)]
  70. protected $destinationPath;
  71. /**
  72. * @var string
  73. */
  74. #[ORM\Column(name: 'origin_path', type: 'string', length: 255)]
  75. protected $originPath;
  76. /**
  77. * @var string
  78. */
  79. #[ORM\Column(name: 'web_path', type: 'string', length: 255)]
  80. protected $webPath;
  81. /**
  82. * @var string
  83. */
  84. #[ORM\Column(name: 'setter_field', type: 'string', length: 255)]
  85. protected $setterField;
  86. /**
  87. * @var string
  88. */
  89. #[ORM\Column(name: 'status', type: 'integer')]
  90. protected $status = self::STATUS_PENDING;
  91. /**
  92. * @var Driver
  93. */
  94. #[ORM\JoinColumn(name: 'from_user_id', referencedColumnName: 'id')]
  95. #[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\User::class, inversedBy: 'clientChangeRequests')]
  96. protected $fromUser;
  97. /**
  98. * @return int
  99. */
  100. public function getId()
  101. {
  102. return $this->id;
  103. }
  104. public static function getPurposeFromString($purpose)
  105. {
  106. switch ($purpose) {
  107. case 'PURPOSE_BADGE_PROOF_PICTURE':
  108. return self::PURPOSE_BADGE_PROOF_PICTURE;
  109. default:
  110. return null;
  111. }
  112. }
  113. public static function getStaticStringPurpose($purpose)
  114. {
  115. return self::$purposeList[$purpose];
  116. }
  117. public function getStringStatus($status)
  118. {
  119. return self::$statusList[$status];
  120. }
  121. public function getStringPurpose($purpose)
  122. {
  123. return self::$purposeList[$purpose];
  124. }
  125. public function getStringType($type)
  126. {
  127. return self::$typeList[$type];
  128. }
  129. /**
  130. * @param DateTime $createdAt
  131. *
  132. * @return ClientChangeRequest
  133. */
  134. public function setCreatedAt($createdAt)
  135. {
  136. $this->createdAt = $createdAt;
  137. return $this;
  138. }
  139. /**
  140. * @return DateTime
  141. */
  142. public function getCreatedAt()
  143. {
  144. return $this->createdAt;
  145. }
  146. /**
  147. * Set purpose
  148. *
  149. * @param int $purpose
  150. *
  151. * @return ClientChangeRequest
  152. */
  153. public function setPurpose($purpose)
  154. {
  155. $this->purpose = $purpose;
  156. return $this;
  157. }
  158. /**
  159. * Get purpose
  160. *
  161. * @return int
  162. */
  163. public function getPurpose()
  164. {
  165. return $this->purpose;
  166. }
  167. /**
  168. * Set value
  169. *
  170. * @param string $value
  171. *
  172. * @return ClientChangeRequest
  173. */
  174. public function setValue($value)
  175. {
  176. $this->value = $value;
  177. return $this;
  178. }
  179. /**
  180. * Get value
  181. *
  182. * @return string
  183. */
  184. public function getValue()
  185. {
  186. return $this->value;
  187. }
  188. /**
  189. * Set class
  190. *
  191. * @param string $class
  192. *
  193. * @return ClientChangeRequest
  194. */
  195. public function setClass($class)
  196. {
  197. $this->class = $class;
  198. return $this;
  199. }
  200. /**
  201. * Get class
  202. *
  203. * @return string
  204. */
  205. public function getClass()
  206. {
  207. return $this->class;
  208. }
  209. /**
  210. * @return integer
  211. */
  212. public function getType()
  213. {
  214. return $this->type;
  215. }
  216. /**
  217. * @param integer $type
  218. *
  219. * @return ClientChangeRequest
  220. */
  221. public function setType($type)
  222. {
  223. $this->type = $type;
  224. return $this;
  225. }
  226. /**
  227. * Set destination
  228. *
  229. * @param integer $destination
  230. *
  231. * @return ClientChangeRequest
  232. */
  233. public function setDestination($destination)
  234. {
  235. $this->destination = $destination;
  236. return $this;
  237. }
  238. /**
  239. * Get destination
  240. *
  241. * @return integer
  242. */
  243. public function getDestination()
  244. {
  245. return $this->destination;
  246. }
  247. /**
  248. * Set status
  249. *
  250. * @param int $status
  251. *
  252. * @return ClientChangeRequest
  253. */
  254. public function setStatus($status)
  255. {
  256. $this->status = $status;
  257. return $this;
  258. }
  259. /**
  260. * Get status
  261. *
  262. * @return int
  263. */
  264. public function getStatus()
  265. {
  266. return $this->status;
  267. }
  268. /**
  269. * Set fromUser
  270. *
  271. * @param User $fromUser
  272. *
  273. * @return ClientChangeRequest
  274. */
  275. public function setFromUser(User $fromUser = null)
  276. {
  277. $this->fromUser = $fromUser;
  278. return $this;
  279. }
  280. /**
  281. * Get fromUser
  282. *
  283. * @return User
  284. */
  285. public function getFromUser()
  286. {
  287. return $this->fromUser;
  288. }
  289. /**
  290. * @return string
  291. */
  292. public function getDestinationId()
  293. {
  294. return $this->destinationId;
  295. }
  296. /**
  297. * @param string $destinationId
  298. *
  299. * @return ClientChangeRequest
  300. */
  301. public function setDestinationId($destinationId)
  302. {
  303. $this->destinationId = $destinationId;
  304. return $this;
  305. }
  306. /**
  307. * @return string
  308. */
  309. public function getDestinationPath()
  310. {
  311. return $this->destinationPath;
  312. }
  313. /**
  314. * @param string $destinationPath
  315. *
  316. * @return ClientChangeRequest
  317. */
  318. public function setDestinationPath($destinationPath)
  319. {
  320. $this->destinationPath = $destinationPath;
  321. return $this;
  322. }
  323. /**
  324. * @return string
  325. */
  326. public function getOriginPath()
  327. {
  328. return $this->originPath;
  329. }
  330. /**
  331. * @param string $originPath
  332. *
  333. * @return ClientChangeRequest
  334. */
  335. public function setOriginPath($originPath)
  336. {
  337. $this->originPath = $originPath;
  338. return $this;
  339. }
  340. /**
  341. * @return string
  342. */
  343. public function getWebPath()
  344. {
  345. return $this->webPath;
  346. }
  347. /**
  348. * @param string $webPath
  349. *
  350. * @return ClientChangeRequest
  351. */
  352. public function setWebPath($webPath)
  353. {
  354. $this->webPath = $webPath;
  355. return $this;
  356. }
  357. /**
  358. * @return string
  359. */
  360. public function getSetterField()
  361. {
  362. return $this->setterField;
  363. }
  364. /**
  365. * @param string $setterField
  366. *
  367. * @return ClientChangeRequest
  368. */
  369. public function setSetterField($setterField)
  370. {
  371. $this->setterField = $setterField;
  372. return $this;
  373. }
  374. }