|
@@ 126-141 (lines=16) @@
|
| 123 |
|
* |
| 124 |
|
* @throws \Doctrine\DBAL\Schema\SchemaException |
| 125 |
|
*/ |
| 126 |
|
protected function _addTable(Table $table) |
| 127 |
|
{ |
| 128 |
|
$namespaceName = $table->getNamespaceName(); |
| 129 |
|
$tableName = $table->getFullQualifiedName($this->getName()); |
| 130 |
|
|
| 131 |
|
if (isset($this->_tables[$tableName])) { |
| 132 |
|
throw SchemaException::tableAlreadyExists($tableName); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
if ( ! $table->isInDefaultNamespace($this->getName()) && ! $this->hasNamespace($namespaceName)) { |
| 136 |
|
$this->createNamespace($namespaceName); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
$this->_tables[$tableName] = $table; |
| 140 |
|
$table->setSchemaConfig($this->_schemaConfig); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
/** |
| 144 |
|
* @param \Doctrine\DBAL\Schema\Sequence $sequence |
|
@@ 150-164 (lines=15) @@
|
| 147 |
|
* |
| 148 |
|
* @throws \Doctrine\DBAL\Schema\SchemaException |
| 149 |
|
*/ |
| 150 |
|
protected function _addSequence(Sequence $sequence) |
| 151 |
|
{ |
| 152 |
|
$namespaceName = $sequence->getNamespaceName(); |
| 153 |
|
$seqName = $sequence->getFullQualifiedName($this->getName()); |
| 154 |
|
|
| 155 |
|
if (isset($this->_sequences[$seqName])) { |
| 156 |
|
throw SchemaException::sequenceAlreadyExists($seqName); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
if ( ! $sequence->isInDefaultNamespace($this->getName()) && ! $this->hasNamespace($namespaceName)) { |
| 160 |
|
$this->createNamespace($namespaceName); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
$this->_sequences[$seqName] = $sequence; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
/** |
| 167 |
|
* Returns the namespaces of this schema. |