Exemplo n.º 1
0
 private function resolveStorageForMnReference($referenceDetails)
 {
     $prefixedTableName = $this->dbSchemaInfo->getPrefixedTableName($referenceDetails['junction-table']);
     if (!$this->tableSchemaStorage->containsSchema($prefixedTableName)) {
         $this->tableSchemaStorage->saveSchema($prefixedTableName);
     }
     $parentStorage = $this->getStorage($referenceDetails['source-entity']);
     return new MnReferenceStorage($parentStorage, $referenceDetails);
 }
Exemplo n.º 2
0
 private function createTable()
 {
     $tableDDL = $this->tableSchemaStorage->getSchema($this->entityInfo->tableName);
     $this->database->query($tableDDL);
 }
function vp_update_table_ddl_scripts(DbSchemaInfo $dbSchemaInfo, TableSchemaStorage $tableSchemaStorage)
{
    $tableSchemaStorage->deleteAll();
    $entityNames = $dbSchemaInfo->getAllEntityNames();
    foreach ($entityNames as $entityName) {
        $table = $dbSchemaInfo->getPrefixedTableName($entityName);
        $tableSchemaStorage->saveSchema($table);
    }
    $referenceDetails = $dbSchemaInfo->getAllMnReferences();
    foreach ($referenceDetails as $referenceDetail) {
        $table = $dbSchemaInfo->getPrefixedTableName($referenceDetail['junction-table']);
        $tableSchemaStorage->saveSchema($table);
    }
}