ExcludeNotification.php 923 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace MGModule\DNSManager2\models\custom\excludenotification;
  3. use MGModule\DNSManager2 as main;
  4. /**
  5. * Log class
  6. *
  7. * @Table(name=excludenotification)
  8. */
  9. class ExcludeNotification extends main\mgLibs\models\orm{
  10. /**
  11. * ID field
  12. *
  13. * @Column(id)
  14. * @var int
  15. */
  16. public $id;
  17. /**
  18. *
  19. * @Column(int)
  20. * @var string
  21. */
  22. public $type;
  23. /**
  24. *
  25. * @Column(int)
  26. * @var int
  27. */
  28. public $relid;
  29. public function setType($type) {
  30. if(!ExcludeNotificationTypeEnum::isValidValue($type))
  31. throw new Exception ("Wrong type provided");
  32. $this->type = $type;
  33. }
  34. public function save($data = array()) {
  35. if(!ExcludeNotificationTypeEnum::isValidValue($this->type)) {
  36. throw new \Exception('Invalid Exclude Notification Type');
  37. }
  38. parent::save($data);
  39. }
  40. }