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
347ec127
Commit
347ec127
authored
Oct 11, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation.
parent
cdc49432
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
25 deletions
+40
-25
Doctrine.php
lib/Doctrine.php
+40
-25
No files found.
lib/Doctrine.php
View file @
347ec127
...
@@ -420,7 +420,6 @@ final class Doctrine
...
@@ -420,7 +420,6 @@ final class Doctrine
*
*
* @param string $directory Path to directory of models or array of directory paths
* @param string $directory Path to directory of models or array of directory paths
* @return void
* @return void
* @author Jonathan H. Wage
*/
*/
public
static
function
loadModels
(
$directory
)
public
static
function
loadModels
(
$directory
)
{
{
...
@@ -449,8 +448,8 @@ final class Doctrine
...
@@ -449,8 +448,8 @@ final class Doctrine
*
*
* Get all the loaded models, you can provide an array of classes or it will use get_declared_classes()
* Get all the loaded models, you can provide an array of classes or it will use get_declared_classes()
*
*
* @pa
ckage default
* @pa
ram $classes Array of classes to filter through, otherwise uses get_declared_classes()
* @
author Jonathan H. Wage
* @
return void
*/
*/
public
static
function
getLoadedModels
(
$classes
=
null
)
public
static
function
getLoadedModels
(
$classes
=
null
)
{
{
...
@@ -489,7 +488,6 @@ final class Doctrine
...
@@ -489,7 +488,6 @@ final class Doctrine
*
*
* @param string $tableName
* @param string $tableName
* @return void
* @return void
* @author Jonathan H. Wage
*/
*/
public
static
function
getConnectionByTableName
(
$tableName
)
public
static
function
getConnectionByTableName
(
$tableName
)
{
{
...
@@ -508,8 +506,8 @@ final class Doctrine
...
@@ -508,8 +506,8 @@ final class Doctrine
* importSchema
* importSchema
* method for importing existing schema to Doctrine_Record classes
* method for importing existing schema to Doctrine_Record classes
*
*
* @param string $directory
* @param string $directory
Directory to write your models to
* @param array $
info
* @param array $
databases Array of databases to generate models for
* @return boolean
* @return boolean
*/
*/
public
static
function
importSchema
(
$directory
,
array
$databases
=
array
())
public
static
function
importSchema
(
$directory
,
array
$databases
=
array
())
...
@@ -521,8 +519,8 @@ final class Doctrine
...
@@ -521,8 +519,8 @@ final class Doctrine
*
*
* Generate your model definitions from an existing database
* Generate your model definitions from an existing database
*
*
* @param string $directory
* @param string $directory
Directory to write your models to
* @param string $
array
* @param string $
databases Array of databases to generate models for
* @return void
* @return void
*/
*/
public
static
function
generateModelsFromDb
(
$directory
,
array
$databases
=
array
())
public
static
function
generateModelsFromDb
(
$directory
,
array
$databases
=
array
())
...
@@ -535,7 +533,7 @@ final class Doctrine
...
@@ -535,7 +533,7 @@ final class Doctrine
* Generates models from database to temporary location then uses those models to generate a yaml schema file.
* Generates models from database to temporary location then uses those models to generate a yaml schema file.
* This should probably be fixed. We should write something to generate a yaml schema file directly from the database.
* This should probably be fixed. We should write something to generate a yaml schema file directly from the database.
*
*
* @param string $yamlPath
* @param string $yamlPath
Path to write oyur yaml schema file to
* @return void
* @return void
*/
*/
public
static
function
generateYamlFromDb
(
$yamlPath
)
public
static
function
generateYamlFromDb
(
$yamlPath
)
...
@@ -553,8 +551,8 @@ final class Doctrine
...
@@ -553,8 +551,8 @@ final class Doctrine
*
*
* Generate a yaml schema file from an existing directory of models
* Generate a yaml schema file from an existing directory of models
*
*
* @param string $yamlPath
* @param string $yamlPath
Path to your yaml schema files
* @param string $directory
* @param string $directory
Directory to generate your models in
* @return void
* @return void
*/
*/
public
static
function
generateModelsFromYaml
(
$yamlPath
,
$directory
)
public
static
function
generateModelsFromYaml
(
$yamlPath
,
$directory
)
...
@@ -567,7 +565,8 @@ final class Doctrine
...
@@ -567,7 +565,8 @@ final class Doctrine
* exportSchema
* exportSchema
* method for exporting Doctrine_Record classes to a schema
* method for exporting Doctrine_Record classes to a schema
*
*
* @param string $directory
* @param string $directory Directory containing your models
* @return void
*/
*/
public
static
function
exportSchema
(
$directory
=
null
)
public
static
function
exportSchema
(
$directory
=
null
)
{
{
...
@@ -578,7 +577,7 @@ final class Doctrine
...
@@ -578,7 +577,7 @@ final class Doctrine
*
*
* Creates database tables for the models in the specified directory
* Creates database tables for the models in the specified directory
*
*
* @param string $directory
* @param string $directory
Directory containing your models
* @return void
* @return void
*/
*/
public
static
function
createTablesFromModels
(
$directory
=
null
)
public
static
function
createTablesFromModels
(
$directory
=
null
)
...
@@ -590,8 +589,8 @@ final class Doctrine
...
@@ -590,8 +589,8 @@ final class Doctrine
*
*
* Generate yaml schema file for the models in the specified directory
* Generate yaml schema file for the models in the specified directory
*
*
* @param string $yamlPath
* @param string $yamlPath
Path to your yaml schema files
* @param string $directory
* @param string $directory
Directory to generate your models in
* @return void
* @return void
*/
*/
public
static
function
generateYamlFromModels
(
$yamlPath
,
$directory
)
public
static
function
generateYamlFromModels
(
$yamlPath
,
$directory
)
...
@@ -605,7 +604,7 @@ final class Doctrine
...
@@ -605,7 +604,7 @@ final class Doctrine
*
*
* Creates databases for connections
* Creates databases for connections
*
*
* @param string $specifiedConnections
* @param string $specifiedConnections
Array of connections you wish to create the database for
* @return void
* @return void
*/
*/
public
static
function
createDatabases
(
$specifiedConnections
)
public
static
function
createDatabases
(
$specifiedConnections
)
...
@@ -629,7 +628,7 @@ final class Doctrine
...
@@ -629,7 +628,7 @@ final class Doctrine
*
*
* Drops databases for connections
* Drops databases for connections
*
*
* @param string $specifiedConnections
* @param string $specifiedConnections
Array of connections you wish to drop the database for
* @return void
* @return void
*/
*/
public
static
function
dropDatabases
(
$specifiedConnections
=
array
())
public
static
function
dropDatabases
(
$specifiedConnections
=
array
())
...
@@ -653,8 +652,8 @@ final class Doctrine
...
@@ -653,8 +652,8 @@ final class Doctrine
*
*
* Dump data to a yaml fixtures file
* Dump data to a yaml fixtures file
*
*
* @param string $yamlPath
* @param string $yamlPath
Path to write the yaml data fixtures to
* @param string $individualFiles
* @param string $individualFiles
Whether or not to dump data to individual fixtures files
* @return void
* @return void
*/
*/
public
static
function
dumpData
(
$yamlPath
,
$individualFiles
=
false
)
public
static
function
dumpData
(
$yamlPath
,
$individualFiles
=
false
)
...
@@ -669,8 +668,8 @@ final class Doctrine
...
@@ -669,8 +668,8 @@ final class Doctrine
* Load data from a yaml fixtures file.
* Load data from a yaml fixtures file.
* The output of dumpData can be fed to loadData
* The output of dumpData can be fed to loadData
*
*
* @param string $yamlPath
* @param string $yamlPath
Path to your yaml data fixtures
* @param string $append
* @param string $append
Whether or not to append the data
* @return void
* @return void
*/
*/
public
static
function
loadData
(
$yamlPath
,
$append
=
false
)
public
static
function
loadData
(
$yamlPath
,
$append
=
false
)
...
@@ -698,8 +697,8 @@ final class Doctrine
...
@@ -698,8 +697,8 @@ final class Doctrine
*
*
* Populdate your models with dummy data
* Populdate your models with dummy data
*
*
* @param string $append
* @param string $append
Whether or not to append the data
* @param string $num
* @param string $num
Number of records to populate
* @return void
* @return void
*/
*/
public
static
function
loadDummyData
(
$append
,
$num
=
5
)
public
static
function
loadDummyData
(
$append
,
$num
=
5
)
...
@@ -722,14 +721,30 @@ final class Doctrine
...
@@ -722,14 +721,30 @@ final class Doctrine
return
$data
->
importDummyData
(
$num
);
return
$data
->
importDummyData
(
$num
);
}
}
/**
* migrate
*
* Migrate database to specified $to version. Migrates from current to latest if you do not specify.
*
* @param string $directory Directory which contains your migration classes
* @param string $to Version you wish to migrate to.
* @return void
*/
public
static
function
migrate
(
$directory
,
$to
=
null
)
public
static
function
migrate
(
$directory
,
$to
=
null
)
{
{
$migration
=
new
Doctrine_Migration
(
$directory
);
$migration
=
new
Doctrine_Migration
(
$directory
);
return
$migration
->
migrate
(
$to
);
return
$migration
->
migrate
(
$to
);
}
}
/**
* generateMigrationClass
*
* Generate new migration class skeleton
*
* @param string $className Name of the Migration class to generate
* @param string $directory Directory which contains your migration classes
* @package default
*/
public
static
function
generateMigrationClass
(
$className
,
$directory
)
public
static
function
generateMigrationClass
(
$className
,
$directory
)
{
{
$migration
=
new
Doctrine_Migration
(
$directory
);
$migration
=
new
Doctrine_Migration
(
$directory
);
...
...
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