CUnsafeValidator.php 987 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * CUnsafeValidator class file.
  4. *
  5. * @author Qiang Xue <qiang.xue@gmail.com>
  6. * @link http://www.yiiframework.com/
  7. * @copyright 2008-2013 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. */
  10. /**
  11. * CUnsafeValidator marks the associated attributes to be unsafe so that they cannot be massively assigned.
  12. *
  13. * @author Qiang Xue <qiang.xue@gmail.com>
  14. * @package system.validators
  15. * @since 1.0
  16. */
  17. class CUnsafeValidator extends CValidator
  18. {
  19. /**
  20. * @var boolean whether attributes listed with this validator should be considered safe for massive assignment.
  21. * Defaults to false.
  22. * @since 1.1.4
  23. */
  24. public $safe=false;
  25. /**
  26. * Validates the attribute of the object.
  27. * This validator does not do any validation as it is meant
  28. * to only mark attributes as unsafe.
  29. * @param CModel $object the object being validated
  30. * @param string $attribute the attribute being validated
  31. */
  32. protected function validateAttribute($object,$attribute)
  33. {
  34. }
  35. }