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
ab76c18f
Commit
ab76c18f
authored
Aug 03, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
013bdebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
Configurable.php
lib/Doctrine/Configurable.php
+40
-2
No files found.
lib/Doctrine/Configurable.php
View file @
ab76c18f
...
...
@@ -38,9 +38,15 @@ abstract class Doctrine_Configurable extends Doctrine_Object
*/
protected
$attributes
=
array
();
/**
* @var
$parent the parents
of this component
* @var
Doctrine_Configurable $parent the parent
of this component
*/
protected
$parent
;
/**
* @var array $_impl an array containing concrete implementations for class templates
* keys as template names and values as names of the concrete
* implementation classes
*/
protected
$_impl
=
array
();
/**
* setAttribute
* sets a given attribute
...
...
@@ -145,11 +151,43 @@ abstract class Doctrine_Configurable extends Doctrine_Object
break
;
default
:
throw
new
Doctrine_Exception
(
"Unknown attribute."
);
}
;
}
$this
->
attributes
[
$attribute
]
=
$value
;
}
/**
* setImpl
* binds given class to given template name
*
* this method is the base of Doctrine dependency injection
*
* @param string $template name of the class template
* @param string $class name of the class to be bound
* @return Doctrine_Configurable this object
*/
public
function
setImpl
(
$template
,
$class
)
{
$this
->
_impl
[
$template
]
=
$class
;
return
$this
;
}
/**
* getImpl
* returns the implementation for given class
*
* @return string name of the concrete implementation
*/
public
function
getImpl
(
$template
)
{
if
(
!
isset
(
$this
->
_impl
[
$attribute
]))
{
if
(
isset
(
$this
->
parent
))
{
return
$this
->
parent
->
getImpl
(
$attribute
);
}
return
null
;
}
return
$this
->
_impl
[
$attribute
];
}
/**
* getCacheDriver
*
...
...
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