30 extends Zend_Validate_Abstract
32 const NAME_EMPTY =
'indexTypeEmpty';
33 const RENAME =
'indexTypeRename';
34 const INVALID =
'indexTypeInvalid';
39 protected $_messageTemplates = array(
40 self::NAME_EMPTY =>
"Index type can not be empty",
41 self::INVALID =>
"Index type %value% is not a valid type",
42 self::RENAME =>
"Cannot change type of existing index"
48 protected $_indexesTypes = array(
64 $value = $schema->__get(
'type');
67 $this->_error(self::NAME_EMPTY);
70 if ($schema && $schema->isDirty(
'type')) {
71 if ($schema->isExist()) {
72 $this->_error(self::RENAME, $value);
75 if (!in_array(strtoupper($value), $this->_indexesTypes)) {
76 $this->_error(self::INVALID, $value);