ValidationBehavior.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Behavior for binding management.
  4. *
  5. * Behavior to simplify manipulating a model's bindings when doing a find operation
  6. *
  7. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  8. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  9. *
  10. * Licensed under The MIT License
  11. * For full copyright and license information, please see the LICENSE.txt
  12. * Redistributions of files must retain the above copyright notice.
  13. *
  14. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  15. * @link http://cakephp.org CakePHP(tm) Project
  16. * @since 3.5.0
  17. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  18. */
  19. namespace TestApp\Model\Behavior;
  20. use Cake\ORM\Behavior;
  21. use Cake\Validation\Validator;
  22. /**
  23. * Description of ValidationBehavior
  24. *
  25. * @author Robert Pustułka <r.pustulka@robotusers.com>
  26. */
  27. class ValidationBehavior extends Behavior
  28. {
  29. public function validationBehavior(Validator $validator)
  30. {
  31. return $validator->add('name', 'behaviorRule');
  32. }
  33. }