Doctrine\DBAL\DBALException::invalidTableName PHP Method

invalidTableName() public static method

public static invalidTableName ( string $tableName ) : DBALException
$tableName string
return DBALException
    public static function invalidTableName($tableName)
    {
        return new self("Invalid table name specified: " . $tableName);
    }

Usage Example

Esempio n. 1
0
 /**
  * @param string                 $tableName
  * @param Column[]               $columns
  * @param Index[]                $indexes
  * @param ForeignKeyConstraint[] $fkConstraints
  * @param integer                $idGeneratorType
  * @param array                  $options
  *
  * @throws DBALException
  */
 public function __construct($tableName, array $columns = array(), array $indexes = array(), array $fkConstraints = array(), $idGeneratorType = 0, array $options = array())
 {
     if (strlen($tableName) == 0) {
         throw DBALException::invalidTableName($tableName);
     }
     $this->_setName($tableName);
     foreach ($columns as $column) {
         $this->_addColumn($column);
     }
     foreach ($indexes as $idx) {
         $this->_addIndex($idx);
     }
     foreach ($fkConstraints as $constraint) {
         $this->_addForeignKeyConstraint($constraint);
     }
     $this->_options = $options;
 }