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
525e7d74
Commit
525e7d74
authored
May 24, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
2d9c165f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
27 deletions
+26
-27
Configurable.php
lib/Doctrine/Configurable.php
+11
-7
Connection.php
lib/Doctrine/Connection.php
+1
-1
Hydrate.php
lib/Doctrine/Hydrate.php
+0
-1
Manager.php
lib/Doctrine/Manager.php
+3
-3
Query.php
lib/Doctrine/Query.php
+8
-12
Record.php
lib/Doctrine/Record.php
+3
-3
No files found.
lib/Doctrine/Configurable.php
View file @
525e7d74
...
...
@@ -64,12 +64,6 @@ abstract class Doctrine_Configurable
public
function
setAttribute
(
$attribute
,
$value
)
{
switch
(
$attribute
)
{
case
Doctrine
::
ATTR_BATCH_SIZE
:
if
(
$value
<
0
)
{
throw
new
Doctrine_Exception
(
"Batch size should be greater than or equal to zero"
);
}
break
;
case
Doctrine
::
ATTR_FETCHMODE
:
if
(
$value
<
0
)
{
throw
new
Doctrine_Exception
(
"Unknown fetchmode. See Doctrine::FETCH_* constants."
);
...
...
@@ -122,6 +116,15 @@ abstract class Doctrine_Configurable
throw
new
Doctrine_Exception
(
"Couldn't set collection key attribute. No such column '
$value
'"
);
}
break
;
case
Doctrine
::
ATTR_DQL_CACHE
:
case
Doctrine
::
ATTR_DQL_PARSER_CACHE
:
case
Doctrine
::
ATTR_SQL_CACHE
:
if
(
$value
!==
null
)
{
if
(
!
(
$value
instanceof
Doctrine_Cache_Interface
))
{
throw
new
Doctrine_Exception
(
'Cache driver should implement Doctrine_Cache_Interface'
);
}
}
break
;
case
Doctrine
::
ATTR_VLD
:
case
Doctrine
::
ATTR_AUTO_LENGTH_VLD
:
case
Doctrine
::
ATTR_AUTO_TYPE_VLD
:
...
...
@@ -225,8 +228,9 @@ abstract class Doctrine_Configurable
{
$attribute
=
(
int
)
$attribute
;
if
(
$attribute
<
0
)
if
(
$attribute
<
0
)
{
throw
new
Doctrine_Exception
(
'Unknown attribute.'
);
}
if
(
!
isset
(
$this
->
attributes
[
$attribute
]))
{
if
(
isset
(
$this
->
parent
))
{
...
...
lib/Doctrine/Connection.php
View file @
525e7d74
...
...
@@ -689,7 +689,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
if
(
!
empty
(
$params
))
{
$stmt
=
$this
->
dbh
->
prepare
(
$query
);
$stmt
->
execute
(
$params
);
return
$stmt
;
return
$stmt
;
}
else
{
return
$this
->
dbh
->
query
(
$query
);
}
...
...
lib/Doctrine/Hydrate.php
View file @
525e7d74
...
...
@@ -374,7 +374,6 @@ class Doctrine_Hydrate
$stmt
=
$this
->
conn
->
execute
(
$query
,
$params
);
$array
=
(
array
)
$this
->
parseData
(
$stmt
);
if
(
empty
(
$this
->
_aliasMap
))
{
throw
new
Doctrine_Hydrate_Exception
(
"Couldn't execute query. Component alias map was empty."
);
}
...
...
lib/Doctrine/Manager.php
View file @
525e7d74
...
...
@@ -100,9 +100,9 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
if
(
!
$init
)
{
$init
=
true
;
$attributes
=
array
(
Doctrine
::
ATTR_
FETCHMODE
=>
Doctrine
::
FETCH_IMMEDIATE
,
Doctrine
::
ATTR_
BATCH_SIZE
=>
5
,
Doctrine
::
ATTR_
COLL_LIMIT
=>
5
,
Doctrine
::
ATTR_
DQL_PARSER_CACHE
=>
null
,
Doctrine
::
ATTR_
DQL_CACHE
=>
null
,
Doctrine
::
ATTR_
SQL_CACHE
=>
null
,
Doctrine
::
ATTR_LISTENER
=>
new
Doctrine_EventListener
(),
Doctrine
::
ATTR_LOCKMODE
=>
1
,
Doctrine
::
ATTR_VLD
=>
false
,
...
...
lib/Doctrine/Query.php
View file @
525e7d74
...
...
@@ -72,9 +72,9 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
* @var array $_options an array of options
*/
protected
$_options
=
array
(
'fetchMode'
=>
Doctrine
::
FETCH_RECORD
,
'
cacheMode'
=>
Doctrine
::
CACHE_NONE
,
'
cache'
=>
false
,
'fetchMode'
=>
Doctrine
::
FETCH_RECORD
,
'
parserCache'
=>
false
,
'
resultSetCache'
=>
false
,
);
/**
* @var array $_dqlParts an array containing all DQL query parts
...
...
@@ -249,7 +249,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
}
else
{
$this
->
_dqlParts
[
$queryPartName
]
=
array
(
$queryPart
);
}
if
(
$this
->
_options
[
'
cache'
]
===
Doctrine
::
CACHE_NONE
)
{
if
(
$this
->
_options
[
'
resultSetCache'
]
||
$this
->
_options
[
'parserCache'
]
)
{
$this
->
getParser
(
$queryPartName
)
->
parse
(
$queryPart
);
}
...
...
@@ -585,17 +585,13 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
public
function
getQuery
(
$params
=
array
())
{
// check if parser cache is on
if
(
$this
->
_options
[
'cacheMode'
]
===
Doctrine
::
CACHE_PARSER
)
{
if
(
!
$this
->
_options
[
'cache'
])
{
throw
new
Doctrine_Query_Exception
(
'Cache not availible. Use setOption() for setting the cache container.'
);
}
if
(
$this
->
_options
[
'parserCache'
]
!==
false
)
{
$dql
=
$this
->
getDql
();
// calculate hash for dql query
$hash
=
strlen
(
$dql
)
.
md5
(
$dql
);
// check if cache has sql equivalent for given hash
$sql
=
$this
->
_options
[
'
c
ache'
]
->
fetch
(
$hash
,
true
);
$sql
=
$this
->
_options
[
'
parserC
ache'
]
->
fetch
(
$hash
,
true
);
if
(
$sql
!==
null
)
{
return
$sql
;
}
...
...
@@ -691,8 +687,8 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
}
// append sql query into cache
if
(
$this
->
_options
[
'
cacheMode'
]
===
Doctrine
::
CACHE_PARSER
)
{
$this
->
_options
[
'
c
ache'
]
->
save
(
$hash
,
$q
);
if
(
$this
->
_options
[
'
parserCache'
]
!==
false
)
{
$this
->
_options
[
'
parserC
ache'
]
->
save
(
$hash
,
$q
);
}
return
$q
;
}
...
...
lib/Doctrine/Record.php
View file @
525e7d74
...
...
@@ -346,8 +346,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
foreach
(
$this
->
_data
as
$column
=>
$value
)
{
$default
=
$this
->
_table
->
getDefaultValueOf
(
$column
);
if
(
$default
===
null
)
if
(
$default
===
null
)
{
$default
=
self
::
$_null
;
}
if
(
$value
===
self
::
$_null
||
$overwrite
)
{
$this
->
_data
[
$column
]
=
$default
;
...
...
@@ -790,7 +791,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
case
Doctrine_Record
::
STATE_TCLEAN
:
$this
->
_state
=
Doctrine_Record
::
STATE_TDIRTY
;
break
;
}
;
}
}
}
else
{
try
{
...
...
@@ -886,7 +887,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$conn
=
$this
->
_table
->
getConnection
();
}
$conn
->
beginTransaction
();
$saveLater
=
$conn
->
unitOfWork
->
saveRelated
(
$this
);
if
(
$this
->
isValid
())
{
...
...
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