InvalidPropertyInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.2.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Datasource;
  16. /**
  17. * Describes the methods that any class representing a data storage should
  18. * comply with.
  19. *
  20. * @method array getInvalid()
  21. * @method mixed getInvalidField($field)
  22. * @method $this setInvalid($field, $value = null, $overwrite = false)
  23. * @method $this setInvalidField($field, $value = null, $overwrite = false)
  24. */
  25. interface InvalidPropertyInterface
  26. {
  27. /**
  28. * Sets a field as invalid and not patchable into the entity.
  29. *
  30. * This is useful for batch operations when one needs to get the original value for an error message after patching.
  31. * This value could not be patched into the entity and is simply copied into the _invalid property for debugging purposes
  32. * or to be able to log it away.
  33. *
  34. * @param string|array|null $field The field to get invalid value for, or the value to set.
  35. * @param mixed|null $value The invalid value to be set for $field.
  36. * @param bool $overwrite Whether or not to overwrite pre-existing values for $field.
  37. * @return $this|mixed
  38. * @deprecated 3.5.0 Use getInvalid()/getInvalidField() and setInvalid()/setInvalidField() instead.
  39. */
  40. public function invalid($field = null, $value = null, $overwrite = false);
  41. }