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
92b395cf
Commit
92b395cf
authored
May 29, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Removing last few dependencies on 2.0
parent
a6fbc199
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
17 deletions
+30
-17
EventArgs.php
lib/Doctrine/Common/EventArgs.php
+1
-0
Connection.php
lib/Doctrine/DBAL/Connection.php
+14
-5
Driver.php
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
+3
-1
AbstractHydrator.php
lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
+2
-2
ArrayHydrator.php
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
+2
-2
ObjectHydrator.php
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
+2
-2
ScalarHydrator.php
lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php
+2
-2
SingleScalarHydrator.php
lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
+2
-2
StandardEntityPersister.php
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
+2
-1
No files found.
lib/Doctrine/Common/EventArgs.php
View file @
92b395cf
...
...
@@ -28,6 +28,7 @@ namespace Doctrine\Common;
* information to an event handler when an event is raised. The single empty EventArgs
* instance can be obtained through {@link getEmptyInstance()}.
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
...
...
lib/Doctrine/DBAL/Connection.php
View file @
92b395cf
...
...
@@ -72,6 +72,15 @@ class Connection
*/
const
TRANSACTION_SERIALIZABLE
=
4
;
/**
* Derived PDO constants
*/
const
FETCH_ASSOC
=
2
;
const
FETCH_BOTH
=
4
;
const
FETCH_COLUMN
=
7
;
const
FETCH_NUM
=
3
;
const
ATTR_AUTOCOMMIT
=
0
;
/**
* The wrapped driver connection.
*
...
...
@@ -280,7 +289,7 @@ class Connection
*/
public
function
fetchRow
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
\PDO
::
FETCH_ASSOC
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
Connection
::
FETCH_ASSOC
);
}
/**
...
...
@@ -292,7 +301,7 @@ class Connection
*/
public
function
fetchArray
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
\PDO
::
FETCH_NUM
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
Connection
::
FETCH_NUM
);
}
/**
...
...
@@ -305,7 +314,7 @@ class Connection
*/
public
function
fetchColumn
(
$statement
,
array
$params
=
array
(),
$colnum
=
0
)
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
\PDO
::
FETCH_COLUMN
,
$colnum
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Connection
::
FETCH_COLUMN
,
$colnum
);
}
/**
...
...
@@ -327,7 +336,7 @@ class Connection
*/
public
function
fetchBoth
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
\PDO
::
FETCH_BOTH
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Connection
::
FETCH_BOTH
);
}
/**
...
...
@@ -498,7 +507,7 @@ class Connection
*/
public
function
fetchAll
(
$sql
,
array
$params
=
array
())
{
return
$this
->
execute
(
$sql
,
$params
)
->
fetchAll
(
\PDO
::
FETCH_ASSOC
);
return
$this
->
execute
(
$sql
,
$params
)
->
fetchAll
(
Connection
::
FETCH_ASSOC
);
}
/**
...
...
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
View file @
92b395cf
...
...
@@ -21,6 +21,8 @@
namespace
Doctrine\DBAL\Driver\PDOMySql
;
use
Doctrine\DBAL\Connection
;
/**
* PDO MySql driver.
*
...
...
@@ -45,7 +47,7 @@ class Driver implements \Doctrine\DBAL\Driver
$password
,
$driverOptions
);
$conn
->
setAttribute
(
\PDO
::
ATTR_AUTOCOMMIT
,
false
);
$conn
->
setAttribute
(
Connection
::
ATTR_AUTOCOMMIT
,
false
);
return
$conn
;
}
...
...
lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
View file @
92b395cf
...
...
@@ -21,9 +21,9 @@
namespace
Doctrine\ORM\Internal\Hydration
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\Common\DoctrineException
;
use
\PDO
;
/**
* Base class for all hydrators. A hydrator is a class that provides some form
...
...
@@ -104,7 +104,7 @@ abstract class AbstractHydrator
*/
public
function
hydrateRow
()
{
$row
=
$this
->
_stmt
->
fetch
(
PDO
::
FETCH_ASSOC
);
$row
=
$this
->
_stmt
->
fetch
(
Connection
::
FETCH_ASSOC
);
if
(
!
$row
)
{
$this
->
_cleanup
();
return
false
;
...
...
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
View file @
92b395cf
...
...
@@ -21,7 +21,7 @@
namespace
Doctrine\ORM\Internal\Hydration
;
use
\PDO
;
use
Doctrine\DBAL\Connection
;
/**
* Description of ArrayHydrator
...
...
@@ -57,7 +57,7 @@ class ArrayHydrator extends AbstractHydrator
{
$result
=
array
();
$cache
=
array
();
while
(
$data
=
$this
->
_stmt
->
fetch
(
PDO
::
FETCH_ASSOC
))
{
while
(
$data
=
$this
->
_stmt
->
fetch
(
Connection
::
FETCH_ASSOC
))
{
$this
->
_hydrateRow
(
$data
,
$cache
,
$result
);
}
...
...
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
View file @
92b395cf
...
...
@@ -21,7 +21,7 @@
namespace
Doctrine\ORM\Internal\Hydration
;
use
\PDO
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\ORM\PersistentCollection
;
use
Doctrine\Common\Collections\Collection
;
...
...
@@ -116,7 +116,7 @@ class ObjectHydrator extends AbstractHydrator
$result
=
$this
->
_rsm
->
isMixed
?
array
()
:
new
Collection
;
$cache
=
array
();
while
(
$data
=
$this
->
_stmt
->
fetch
(
PDO
::
FETCH_ASSOC
))
{
while
(
$data
=
$this
->
_stmt
->
fetch
(
Connection
::
FETCH_ASSOC
))
{
$this
->
_hydrateRow
(
$data
,
$cache
,
$result
);
}
...
...
lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php
View file @
92b395cf
...
...
@@ -21,7 +21,7 @@
namespace
Doctrine\ORM\Internal\Hydration
;
use
\PDO
;
use
Doctrine\DBAL\Connection
;
/**
* Hydrator that produces flat, rectangular results of scalar data.
...
...
@@ -38,7 +38,7 @@ class ScalarHydrator extends AbstractHydrator
{
$result
=
array
();
$cache
=
array
();
while
(
$data
=
$this
->
_stmt
->
fetch
(
PDO
::
FETCH_ASSOC
))
{
while
(
$data
=
$this
->
_stmt
->
fetch
(
Connection
::
FETCH_ASSOC
))
{
$result
[]
=
$this
->
_gatherScalarRowData
(
$data
,
$cache
);
}
return
$result
;
...
...
lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
View file @
92b395cf
...
...
@@ -21,7 +21,7 @@
namespace
Doctrine\ORM\Internal\Hydration
;
use
\PDO
;
use
Doctrine\DBAL\Connection
;
/**
* Description of SingleScalarHydrator
...
...
@@ -34,7 +34,7 @@ class SingleScalarHydrator extends AbstractHydrator
protected
function
_hydrateAll
()
{
$cache
=
array
();
$result
=
$this
->
_stmt
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
$result
=
$this
->
_stmt
->
fetchAll
(
Connection
::
FETCH_ASSOC
);
//TODO: Let this exception be raised by Query as QueryException
if
(
count
(
$result
)
>
1
||
count
(
$result
[
0
])
>
1
)
{
throw
HydrationException
::
nonUniqueResult
();
...
...
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
View file @
92b395cf
...
...
@@ -21,6 +21,7 @@
namespace
Doctrine\ORM\Persisters
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\ORM\EntityManager
;
use
Doctrine\ORM\UnitOfWork
;
...
...
@@ -339,7 +340,7 @@ class StandardEntityPersister
$stmt
=
$this
->
_conn
->
prepare
(
$this
->
_getSelectSingleEntitySql
(
$criteria
));
$stmt
->
execute
(
array_values
(
$criteria
));
$data
=
array
();
foreach
(
$stmt
->
fetch
(
\PDO
::
FETCH_ASSOC
)
as
$column
=>
$value
)
{
foreach
(
$stmt
->
fetch
(
Connection
::
FETCH_ASSOC
)
as
$column
=>
$value
)
{
$fieldName
=
$this
->
_class
->
fieldNames
[
$column
];
$data
[
$fieldName
]
=
Type
::
getType
(
$this
->
_class
->
getTypeOfField
(
$fieldName
))
->
convertToPHPValue
(
$value
);
...
...
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