MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
SchemaException.php
Ir para a documentação deste ficheiro.
1<?php
2
4
6{
17
22 static public function tableDoesNotExist($tableName)
23 {
24 return new self("There is no table with name '".$tableName."' in the schema.", self::TABLE_DOESNT_EXIST);
25 }
26
31 static public function indexNameInvalid($indexName)
32 {
33 return new self("Invalid index-name $indexName given, has to be [a-zA-Z0-9_]", self::INDEX_INVALID_NAME);
34 }
35
40 static public function indexDoesNotExist($indexName, $table)
41 {
42 return new self("Index '$indexName' does not exist on table '$table'.", self::INDEX_DOESNT_EXIST);
43 }
44
49 static public function indexAlreadyExists($indexName, $table)
50 {
51 return new self("An index with name '$indexName' was already defined on table '$table'.", self::INDEX_ALREADY_EXISTS);
52 }
53
58 static public function columnDoesNotExist($columnName, $table)
59 {
60 return new self("There is no column with name '$columnName' on table '$table'.", self::COLUMN_DOESNT_EXIST);
61 }
62
68 static public function tableAlreadyExists($tableName)
69 {
70 return new self("The table with name '".$tableName."' already exists.", self::TABLE_ALREADY_EXISTS);
71 }
72
79 static public function columnAlreadyExists($tableName, $columnName)
80 {
81 return new self(
82 "The column '".$columnName."' on table '".$tableName."' already exists.", self::COLUMN_ALREADY_EXISTS
83 );
84 }
85
90 static public function sequenceAlreadyExists($sequenceName)
91 {
92 return new self("The sequence '".$sequenceName."' already exists.", self::SEQUENCE_ALREADY_EXISTS);
93 }
94
99 static public function sequenceDoesNotExist($sequenceName)
100 {
101 return new self("There exists no sequence with the name '".$sequenceName."'.", self::SEQUENCE_DOENST_EXIST);
102 }
103
108 static public function foreignKeyDoesNotExist($fkName, $table)
109 {
110 return new self("There exists no foreign key with the name '$fkName' on table '$table'.", self::FOREIGNKEY_DOESNT_EXIST);
111 }
112
113 static public function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
114 {
115 return new self(
116 "The performed schema operation on ".$localTable->getName()." requires a named foreign key, ".
117 "but the given foreign key from (".implode(", ", $foreignKey->getColumns()).") onto foreign table ".
118 "'".$foreignKey->getForeignTableName()."' (".implode(", ", $foreignKey->getForeignColumns()).") is currently ".
119 "unnamed."
120 );
121 }
122
123 static public function alterTableChangeNotSupported($changeName) {
124 return new self ("Alter table change not supported, given '$changeName'");
125 }
126}
static indexAlreadyExists($indexName, $table)
static sequenceDoesNotExist($sequenceName)
static columnAlreadyExists($tableName, $columnName)
static columnDoesNotExist($columnName, $table)
static namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
static indexDoesNotExist($indexName, $table)
static foreignKeyDoesNotExist($fkName, $table)
static sequenceAlreadyExists($sequenceName)
static alterTableChangeNotSupported($changeName)