Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
e4a38a74
Commit
e4a38a74
authored
Nov 28, 2009
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] - DDC-169 - Extracted Method for the generation of a Schema Instance from Doctrine Metadata.
parent
b21553c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
SchemaTool.php
lib/Doctrine/ORM/Tools/SchemaTool.php
+13
-3
No files found.
lib/Doctrine/ORM/Tools/SchemaTool.php
View file @
e4a38a74
...
@@ -95,9 +95,19 @@ class SchemaTool
...
@@ -95,9 +95,19 @@ class SchemaTool
*/
*/
public
function
getCreateSchemaSql
(
array
$classes
)
public
function
getCreateSchemaSql
(
array
$classes
)
{
{
$sql
=
array
();
// All SQL statements
$schema
=
$this
->
getSchemaFromMetadata
(
$classes
);
return
$schema
->
toSql
(
$this
->
_platform
);
}
/**
* From a given set of metadata classes this method creates a Schema instance.
*
* @param array $classes
* @return Schema
*/
public
function
getSchemaFromMetadata
(
array
$classes
)
{
$processedClasses
=
array
();
// Reminder for processed classes, used for hierarchies
$processedClasses
=
array
();
// Reminder for processed classes, used for hierarchies
$sequences
=
array
();
// Sequence SQL statements. Appended to $sql at the end.
$schema
=
new
\Doctrine\DBAL\Schema\Schema
();
$schema
=
new
\Doctrine\DBAL\Schema\Schema
();
...
@@ -210,7 +220,7 @@ class SchemaTool
...
@@ -210,7 +220,7 @@ class SchemaTool
}
}
}
}
return
$schema
->
toSql
(
$this
->
_platform
)
;
return
$schema
;
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment