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
1f18a99f
Commit
1f18a99f
authored
Jan 23, 2008
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #659
parent
3018a9e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
Configurable.php
lib/Doctrine/Configurable.php
+21
-4
No files found.
lib/Doctrine/Configurable.php
View file @
1f18a99f
...
@@ -66,6 +66,10 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
...
@@ -66,6 +66,10 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
* // or
* // or
*
*
* $manager->setAttribute('portability', Doctrine::PORTABILITY_ALL);
* $manager->setAttribute('portability', Doctrine::PORTABILITY_ALL);
*
* // or
*
* $manager->setAttribute('portability', 'all');
* </code>
* </code>
*
*
* @param mixed $attribute either a Doctrine::ATTR_* integer constant or a string
* @param mixed $attribute either a Doctrine::ATTR_* integer constant or a string
...
@@ -75,18 +79,31 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
...
@@ -75,18 +79,31 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
* @throws Doctrine_Exception if the value is invalid
* @throws Doctrine_Exception if the value is invalid
* @return void
* @return void
*/
*/
public
function
setAttribute
(
$attribute
,
$value
)
public
function
setAttribute
(
$attribute
,
$value
)
{
{
if
(
is_string
(
$attribute
))
{
if
(
is_string
(
$attribute
))
{
$upper
=
strtoupper
(
$attribute
);
$upper
=
strtoupper
(
$attribute
);
$const
=
'Doctrine::ATTR_'
.
$attribute
;
$const
=
'Doctrine::ATTR_'
.
$upper
;
if
(
defined
(
$const
))
{
if
(
defined
(
$const
))
{
$this
->
_state
=
constant
(
$const
);
$attribute
=
constant
(
$const
);
$this
->
_state
=
$attribute
;
}
else
{
}
else
{
throw
new
Doctrine_Exception
(
'Unknown attribute
'
.
$attribute
);
throw
new
Doctrine_Exception
(
'Unknown attribute
: "'
.
$attribute
.
'"'
);
}
}
}
}
if
(
is_string
(
$value
)
&&
isset
(
$upper
))
{
$const
=
'Doctrine::'
.
$upper
.
'_'
.
strtoupper
(
$value
);
if
(
defined
(
$const
))
{
$value
=
constant
(
$const
);
}
else
{
throw
new
Doctrine_Exception
(
'Unknown attribute value: "'
.
$value
.
'"'
);
}
}
switch
(
$attribute
)
{
switch
(
$attribute
)
{
case
Doctrine
::
ATTR_FETCHMODE
:
case
Doctrine
::
ATTR_FETCHMODE
:
throw
new
Doctrine_Exception
(
'Deprecated attribute. See http://www.phpdoctrine.org/documentation/manual?chapter=configuration'
);
throw
new
Doctrine_Exception
(
'Deprecated attribute. See http://www.phpdoctrine.org/documentation/manual?chapter=configuration'
);
...
...
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