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
8e1f1578
Commit
8e1f1578
authored
Nov 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nested plugin functionality added
parent
edfd9f65
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
25 deletions
+38
-25
Export.php
lib/Doctrine/Export.php
+6
-2
I18n.php
lib/Doctrine/I18n.php
+4
-1
Plugin.php
lib/Doctrine/Plugin.php
+17
-1
Template.php
lib/Doctrine/Template.php
+8
-0
I18n.php
lib/Doctrine/Template/I18n.php
+1
-18
Searchable.php
lib/Doctrine/Template/Searchable.php
+1
-3
Versionable.php
lib/Doctrine/Template/Versionable.php
+1
-0
No files found.
lib/Doctrine/Export.php
View file @
8e1f1578
...
...
@@ -1169,7 +1169,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
*
* @param Doctrine_Table $table table object to retrieve the plugins from
* @return array an array of Doctrine_Plugin objects
*/
*/
public
function
getAllPlugins
(
Doctrine_Table
$table
)
{
$plugins
=
array
();
...
...
@@ -1183,7 +1183,11 @@ class Doctrine_Export extends Doctrine_Connection_Module
$plugins
[]
=
$plugin
;
$plugins
=
array_merge
(
$plugins
,
$this
->
getAllPlugins
(
$plugin
->
getOption
(
'pluginTable'
)));
$pluginTable
=
$plugin
->
getOption
(
'pluginTable'
);
if
(
$pluginTable
instanceof
Doctrine_Table
)
{
$plugins
=
array_merge
(
$plugins
,
$this
->
getAllPlugins
(
$pluginTable
));
}
}
return
$plugins
;
...
...
lib/Doctrine/I18n.php
View file @
8e1f1578
...
...
@@ -38,6 +38,7 @@ class Doctrine_I18n extends Doctrine_Plugin
'generateFiles'
=>
false
,
'table'
=>
false
,
'pluginTable'
=>
false
,
'children'
=>
array
(),
);
/**
...
...
@@ -123,6 +124,8 @@ class Doctrine_I18n extends Doctrine_Plugin
$this
->
_options
[
'pluginTable'
]
->
bindQueryPart
(
'indexBy'
,
'lang'
);
$this
->
generateChildDefinitions
();
return
true
;
}
}
\ No newline at end of file
}
lib/Doctrine/Plugin.php
View file @
8e1f1578
...
...
@@ -91,6 +91,11 @@ class Doctrine_Plugin
return
$this
;
}
public
function
addChild
(
Doctrine_Template
$template
)
{
$this
->
_options
[
'children'
][]
=
$template
;
}
/**
* returns all options and their associated values
*
...
...
@@ -101,6 +106,17 @@ class Doctrine_Plugin
return
$this
->
_options
;
}
public
function
generateChildDefinitions
()
{
foreach
(
$this
->
_options
[
'children'
]
as
$child
)
{
$this
->
_options
[
'pluginTable'
]
->
addTemplate
(
get_class
(
$child
),
$child
);
$child
->
setTable
(
$this
->
_options
[
'pluginTable'
]);
$child
->
setUp
();
}
}
/**
* generates foreign keys for the plugin table based on the owner table
*
...
...
@@ -180,4 +196,4 @@ class Doctrine_Plugin
eval
(
$def
);
}
}
}
\ No newline at end of file
}
lib/Doctrine/Template.php
View file @
8e1f1578
...
...
@@ -85,6 +85,14 @@ class Doctrine_Template extends Doctrine_Record_Abstract
return
$this
->
_invoker
;
}
public
function
addChild
(
Doctrine_Template
$template
)
{
$this
->
_plugin
->
addChild
(
$template
);
return
$this
;
}
public
function
getPlugin
()
{
return
$this
->
_plugin
;
...
...
lib/Doctrine/Template/I18n.php
View file @
8e1f1578
...
...
@@ -32,8 +32,6 @@
*/
class
Doctrine_Template_I18n
extends
Doctrine_Template
{
protected
$_translation
;
/**
* __construct
*
...
...
@@ -44,21 +42,6 @@ class Doctrine_Template_I18n extends Doctrine_Template
{
$this
->
_plugin
=
new
Doctrine_I18n
(
$options
);
}
/**
* translation
*
* sets or retrieves the current translation language
*
* @return Doctrine_Record this object
*/
public
function
translation
(
$language
=
null
)
{
$this
->
_translation
=
$language
;
return
$this
->
_translation
;
}
/**
* setUp
*
...
...
@@ -91,4 +74,4 @@ class Doctrine_Template_I18n extends Doctrine_Template
{
return
$this
->
_plugin
;
}
}
\ No newline at end of file
}
lib/Doctrine/Template/Searchable.php
View file @
8e1f1578
...
...
@@ -34,9 +34,7 @@ class Doctrine_Template_Searchable extends Doctrine_Template
{
public
function
__construct
(
array
$options
)
{
$this
->
_plugin
=
new
Doctrine_Search
(
$options
);
$this
->
_plugin
=
new
Doctrine_Search
(
$options
);
}
public
function
getPlugin
()
...
...
lib/Doctrine/Template/Versionable.php
View file @
8e1f1578
...
...
@@ -47,4 +47,5 @@ class Doctrine_Template_Versionable extends Doctrine_Template
{
return
$this
->
_plugin
;
}
}
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