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
ec6120b9
Commit
ec6120b9
authored
Sep 06, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
eed20359
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
+43
-2
Export.php
lib/Doctrine/Export.php
+29
-2
I18n.php
lib/Doctrine/I18n.php
+3
-0
Template.php
lib/Doctrine/Template.php
+11
-0
No files found.
lib/Doctrine/Export.php
View file @
ec6120b9
...
...
@@ -1043,7 +1043,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
// check if class is an instance of Doctrine_Record and not abstract
// class must have method setTableDefinition (to avoid non-Record subclasses like symfony's sfDoctrineRecord)
// we have to recursively iterate through the class parents just to be sure that the classes using for example
// column aggregation inheritance are properly exporte
r
d to database
// column aggregation inheritance are properly exported to database
while
(
$class
->
isAbstract
()
||
!
$class
->
isSubclassOf
(
$parent
)
||
!
$class
->
hasMethod
(
'setTableDefinition'
)
||
...
...
@@ -1057,11 +1057,12 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
if
(
$class
===
false
)
{
continue
;
continue
;
}
$record
=
new
$name
();
$table
=
$record
->
getTable
();
$data
=
$table
->
getExportableFormat
();
$query
=
$this
->
conn
->
export
->
createTableSql
(
$data
[
'tableName'
],
$data
[
'columns'
],
$data
[
'options'
]);
...
...
@@ -1071,12 +1072,38 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
else
{
$sql
[]
=
$query
;
}
if
(
$table
->
getAttribute
(
Doctrine
::
ATTR_EXPORT
)
&
Doctrine
::
EXPORT_PLUGINS
)
{
$sql
=
array_merge
(
$sql
,
$this
->
exportPluginsSql
(
$table
));
}
}
$sql
=
array_unique
(
$sql
);
rsort
(
$sql
);
return
$sql
;
}
/**
* exportPluginsSql
* exports plugin tables for given table
*
* @param Doctrine_Table $table the table in which the plugins belong to
* @return array an array of sql strings
*/
public
function
exportPluginsSql
(
Doctrine_Table
$table
)
{
$sql
=
array
();
foreach
(
$table
->
getTemplates
()
as
$name
=>
$template
)
{
$table
=
$template
->
getPlugin
()
->
getOption
(
'pluginTable'
);
$data
=
$table
->
getExportableFormat
();
$query
=
$this
->
conn
->
export
->
createTableSql
(
$data
[
'tableName'
],
$data
[
'columns'
],
$data
[
'options'
]);
$sql
=
array_merge
(
$sql
,
(
array
)
$query
);
}
return
$sql
;
}
/**
* exportSql
* returns the sql for exporting Doctrine_Record classes to a schema
...
...
lib/Doctrine/I18n.php
View file @
ec6120b9
...
...
@@ -36,6 +36,7 @@ class Doctrine_I18n extends Doctrine_Plugin
'fields'
=>
array
(),
'generateFiles'
=>
false
,
'table'
=>
false
,
'pluginTable'
=>
false
,
);
protected
$_auditTable
;
...
...
@@ -109,6 +110,8 @@ class Doctrine_I18n extends Doctrine_Plugin
if
(
!
$this
->
_options
[
'generateFiles'
])
{
eval
(
$def
);
}
$this
->
_options
[
'pluginTable'
]
=
$table
->
getConnection
()
->
getTable
(
$this
->
_options
[
'className'
]);
return
true
;
}
}
lib/Doctrine/Template.php
View file @
ec6120b9
...
...
@@ -36,6 +36,9 @@ class Doctrine_Template extends Doctrine_Record_Abstract
* @param Doctrine_Record $_invoker the record that invoked the last delegated call
*/
protected
$_invoker
;
protected
$_plugin
;
/**
* setTable
*
...
...
@@ -77,6 +80,14 @@ class Doctrine_Template extends Doctrine_Record_Abstract
{
return
$this
->
_invoker
;
}
public
function
get
()
{
throw
new
Exception
();
}
public
function
getPlugin
()
{
return
$this
->
_plugin
;
}
public
function
setUp
()
{
...
...
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