ValidationResults.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Customer\Model\Data;
  8. /**
  9. * Validation results data model.
  10. */
  11. class ValidationResults extends \Magento\Framework\Api\AbstractSimpleObject implements
  12. \Magento\Customer\Api\Data\ValidationResultsInterface
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public function isValid()
  18. {
  19. return $this->_get(self::VALID);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function getMessages()
  25. {
  26. return $this->_get(self::MESSAGES);
  27. }
  28. /**
  29. * Set if the provided data is valid.
  30. *
  31. * @param bool $isValid
  32. * @return $this
  33. */
  34. public function setIsValid($isValid)
  35. {
  36. return $this->setData(self::VALID, $isValid);
  37. }
  38. /**
  39. * Set error messages as array in case of validation failure.
  40. *
  41. * @param string[] $messages
  42. * @return string[]
  43. */
  44. public function setMessages(array $messages)
  45. {
  46. return $this->setData(self::MESSAGES, $messages);
  47. }
  48. }