IntegerValueValidator.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\Validators;
  3. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Validators\BaseValidator;
  4. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Validators\boolen;
  5. /**
  6. *
  7. * Created by PhpStorm.
  8. * User: Tomasz Bielecki ( tomasz.bi@thurdata.com )
  9. * Date: 08.11.19
  10. * Time: 10:18
  11. * Class IntegerValueValidator
  12. */
  13. class IntegerValueValidator extends BaseValidator
  14. {
  15. /**
  16. * @var bool
  17. */
  18. protected $disableNegative = false;
  19. /**
  20. * IntegerValueValidator constructor.
  21. * @param bool $disableNegative
  22. */
  23. public function __construct($disableNegative = false)
  24. {
  25. $this->disableNegative = $disableNegative;
  26. }
  27. /**
  28. * @return bool
  29. */
  30. public function isDisableNegative()
  31. {
  32. return $this->disableNegative;
  33. }
  34. /**
  35. * @param bool $disableNegative
  36. */
  37. public function setDisableNegative($disableNegative)
  38. {
  39. $this->disableNegative = $disableNegative;
  40. }
  41. /**
  42. * return true if data is valid, false if not,
  43. * add error messages to $errorsList
  44. *
  45. * @param $data mixed
  46. * @param $additionalData mixed
  47. * @return boolen
  48. */
  49. protected function validate($data, $additionalData = null)
  50. {
  51. if(is_numeric($data))
  52. {
  53. }
  54. }
  55. }