ZendDbSchema
Schema management for Zend Framework
 All Classes Namespaces Functions Pages
Charset.php
1 <?php
30  extends Zend_Validate_Abstract
31 {
32  const ENGINE_EMPTY = 'databaseEngineEmpty';
33  const INVALID = 'databaseEngineInvalid';
34  const NOT_AVAIBLE = 'databaseEngineNotAvaible';
35 
39  protected $_messageTemplates = array(
40  self::ENGINE_EMPTY => "Database engine can not be empty",
41  self::INVALID => 'Engine %value% is not valid engine type',
42  self::NOT_AVAIBLE => "Engine %value% is not avaible"
43  );
44 
51  public function isValid($value)
52  {
53  $schema = null;
54  if ($value instanceof ZendDbSchema_Db_Schema_Database) {
55  $schema = $value;
56  $value = $schema->getName();
57  }
58 
59  if (empty($value)) {
60  $this->_error(self::NAME_EMPTY);
61  return false;
62  }
63  return true;
64  }
65 }