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
01e41f3d
Commit
01e41f3d
authored
Nov 01, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added possibility for setting user-defined params
parent
cdcaab1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
25 deletions
+58
-25
Doctrine.php
lib/Doctrine.php
+11
-10
Configurable.php
lib/Doctrine/Configurable.php
+31
-0
Manager.php
lib/Doctrine/Manager.php
+16
-15
No files found.
lib/Doctrine.php
View file @
01e41f3d
...
...
@@ -176,16 +176,17 @@ final class Doctrine
const
ATTR_USE_NATIVE_ENUM
=
117
;
const
ATTR_DEFAULT_SEQUENCE
=
133
;
const
ATTR_FETCHMODE
=
118
;
const
ATTR_NAME_PREFIX
=
121
;
const
ATTR_CREATE_TABLES
=
122
;
const
ATTR_COLL_LIMIT
=
123
;
const
ATTR_FETCHMODE
=
118
;
const
ATTR_NAME_PREFIX
=
121
;
const
ATTR_CREATE_TABLES
=
122
;
const
ATTR_COLL_LIMIT
=
123
;
const
ATTR_CACHE
=
150
;
const
ATTR_CACHE_LIFESPAN
=
151
;
const
ATTR_LOAD_REFERENCES
=
153
;
const
ATTR_RECORD_LISTENER
=
154
;
const
ATTR_THROW_EXCEPTIONS
=
155
;
const
ATTR_CACHE
=
150
;
const
ATTR_CACHE_LIFESPAN
=
151
;
const
ATTR_LOAD_REFERENCES
=
153
;
const
ATTR_RECORD_LISTENER
=
154
;
const
ATTR_THROW_EXCEPTIONS
=
155
;
const
ATTR_DEFAULT_PARAM_NAMESPACE
=
156
;
/**
* LIMIT CONSTANTS
...
...
@@ -1040,4 +1041,4 @@ final class Doctrine
return
mkdir
(
$path
,
$mode
,
true
);
}
}
\ No newline at end of file
}
lib/Doctrine/Configurable.php
View file @
01e41f3d
...
...
@@ -50,6 +50,11 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
* implementation classes
*/
protected
$_impl
=
array
();
/**
* @var array $_params an array of user defined parameters
*/
protected
$_params
=
array
();
/**
* setAttribute
...
...
@@ -116,6 +121,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
case
Doctrine
::
ATTR_LOAD_REFERENCES
:
case
Doctrine
::
ATTR_RECORD_LISTENER
:
case
Doctrine
::
ATTR_THROW_EXCEPTIONS
:
case
Doctrine
::
ATTR_DEFAULT_PARAM_NAMESPACE
:
break
;
case
Doctrine
::
ATTR_SEQCOL_NAME
:
...
...
@@ -143,6 +149,31 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
}
public
function
setParam
(
$name
,
$value
,
$namespace
=
null
)
{
if
(
$namespace
=
null
)
{
$namespace
=
$this
->
getAttribute
(
Doctrine
::
ATTR_DEFAULT_PARAM_NAMESPACE
);
}
$this
->
_params
[
$namespace
][
$name
]
=
$value
;
return
$this
;
}
public
function
getParam
(
$name
,
$value
,
$namespace
)
{
if
(
$namespace
=
null
)
{
$namespace
=
$this
->
getAttribute
(
Doctrine
::
ATTR_DEFAULT_PARAM_NAMESPACE
);
}
if
(
!
isset
(
$this
->
_params
[
$name
]))
{
if
(
isset
(
$this
->
parent
))
{
return
$this
->
parent
->
getParam
(
$name
);
}
return
null
;
}
return
$this
->
_params
[
$name
];
}
/**
* setImpl
* binds given class to given template name
...
...
lib/Doctrine/Manager.php
View file @
01e41f3d
...
...
@@ -90,21 +90,22 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
if
(
!
$init
)
{
$init
=
true
;
$attributes
=
array
(
Doctrine
::
ATTR_CACHE
=>
null
,
Doctrine
::
ATTR_LOAD_REFERENCES
=>
true
,
Doctrine
::
ATTR_LISTENER
=>
new
Doctrine_EventListener
(),
Doctrine
::
ATTR_RECORD_LISTENER
=>
new
Doctrine_Record_Listener
(),
Doctrine
::
ATTR_THROW_EXCEPTIONS
=>
true
,
Doctrine
::
ATTR_VALIDATE
=>
Doctrine
::
VALIDATE_NONE
,
Doctrine
::
ATTR_QUERY_LIMIT
=>
Doctrine
::
LIMIT_RECORDS
,
Doctrine
::
ATTR_IDXNAME_FORMAT
=>
"%s_idx"
,
Doctrine
::
ATTR_SEQNAME_FORMAT
=>
"%s_seq"
,
Doctrine
::
ATTR_TBLNAME_FORMAT
=>
"%s"
,
Doctrine
::
ATTR_QUOTE_IDENTIFIER
=>
false
,
Doctrine
::
ATTR_SEQCOL_NAME
=>
'id'
,
Doctrine
::
ATTR_PORTABILITY
=>
Doctrine
::
PORTABILITY_ALL
,
Doctrine
::
ATTR_EXPORT
=>
Doctrine
::
EXPORT_ALL
,
Doctrine
::
ATTR_DECIMAL_PLACES
=>
2
,
Doctrine
::
ATTR_CACHE
=>
null
,
Doctrine
::
ATTR_LOAD_REFERENCES
=>
true
,
Doctrine
::
ATTR_LISTENER
=>
new
Doctrine_EventListener
(),
Doctrine
::
ATTR_RECORD_LISTENER
=>
new
Doctrine_Record_Listener
(),
Doctrine
::
ATTR_THROW_EXCEPTIONS
=>
true
,
Doctrine
::
ATTR_VALIDATE
=>
Doctrine
::
VALIDATE_NONE
,
Doctrine
::
ATTR_QUERY_LIMIT
=>
Doctrine
::
LIMIT_RECORDS
,
Doctrine
::
ATTR_IDXNAME_FORMAT
=>
"%s_idx"
,
Doctrine
::
ATTR_SEQNAME_FORMAT
=>
"%s_seq"
,
Doctrine
::
ATTR_TBLNAME_FORMAT
=>
"%s"
,
Doctrine
::
ATTR_QUOTE_IDENTIFIER
=>
false
,
Doctrine
::
ATTR_SEQCOL_NAME
=>
'id'
,
Doctrine
::
ATTR_PORTABILITY
=>
Doctrine
::
PORTABILITY_ALL
,
Doctrine
::
ATTR_EXPORT
=>
Doctrine
::
EXPORT_ALL
,
Doctrine
::
ATTR_DECIMAL_PLACES
=>
2
,
Doctrine
::
ATTR_DEFAULT_PARAM_NAMESPACE
=>
'doctrine'
,
);
foreach
(
$attributes
as
$attribute
=>
$value
)
{
$old
=
$this
->
getAttribute
(
$attribute
);
...
...
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