src/framework/DatabaseContainer.php 1 location
|
@@ 34-49 (lines=16) @@
|
| 31 |
|
/** |
| 32 |
|
* @inheritdoc |
| 33 |
|
*/ |
| 34 |
|
public function getType($type) |
| 35 |
|
{ |
| 36 |
|
if (! $this->has($type)) { |
| 37 |
|
$this->register($type); // auto-wiring (for Types with no special constructor dependencies) |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
$type = $this->get($type); |
| 41 |
|
|
| 42 |
|
if (! $type instanceof Type) { |
| 43 |
|
$class_name = get_class($type); |
| 44 |
|
|
| 45 |
|
throw new UnexpectedValueException("{$class_name} does not implement the Type interface"); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
return $type; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
/** |
| 52 |
|
* @inheritdoc |
src/framework/Database.php 1 location
|
@@ 37-52 (lines=16) @@
|
| 34 |
|
* |
| 35 |
|
* @return Schema |
| 36 |
|
*/ |
| 37 |
|
public function getSchema($schema) |
| 38 |
|
{ |
| 39 |
|
if (! $this->container->has($schema)) { |
| 40 |
|
$this->container->register($schema); // auto-wiring (for Schema with no special constructor dependencies) |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
$schema = $this->container->get($schema); |
| 44 |
|
|
| 45 |
|
if (! $schema instanceof Schema) { |
| 46 |
|
$class_name = get_class($schema); |
| 47 |
|
|
| 48 |
|
throw new UnexpectedValueException("{$class_name} does not extend the Schema class"); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
return $schema; |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
/** |
| 55 |
|
* @param Table $from |