Array.php 389 B

12345678910111213141516171819202122
  1. <?php
  2. require_once 'Zend/Validate/Abstract.php';
  3. class Mooses_Mongodb_Mongo_Validate_Array extends Zend_Validate_Abstract
  4. {
  5. const NOT_ARRAY = 'notArray';
  6. protected $_messageTemplates = array(
  7. self::NOT_ARRAY => "Value is not an Array"
  8. );
  9. public function isValid($value)
  10. {
  11. if (!is_array($value)) {
  12. $this->_error(self::NOT_ARRAY);
  13. return false;
  14. }
  15. return true;
  16. }
  17. }