InvalidPropertyInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since 3.2.0
  13. * @license http://www.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. interface InvalidPropertyInterface
  21. {
  22. /**
  23. * Sets a field as invalid and not patchable into the entity.
  24. *
  25. * This is useful for batch operations when one needs to get the original value for an error message after patching.
  26. * This value could not be patched into the entity and is simply copied into the _invalid property for debugging purposes
  27. * or to be able to log it away.
  28. *
  29. * @param string|array|null $field The field to get invalid value for, or the value to set.
  30. * @param mixed|null $value The invalid value to be set for $field.
  31. * @param bool $overwrite Whether or not to overwrite pre-existing values for $field.
  32. * @return $this|mixed
  33. */
  34. public function invalid($field = null, $value = null, $overwrite = false);
  35. }