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
1aeff68c
Commit
1aeff68c
authored
Jul 10, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Initial commit to make hydration work with C extension
parent
ba8b4337
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
Configuration.php
lib/Doctrine/ORM/Configuration.php
+12
-1
UnitOfWork.php
lib/Doctrine/ORM/UnitOfWork.php
+15
-3
No files found.
lib/Doctrine/ORM/Configuration.php
View file @
1aeff68c
...
...
@@ -47,7 +47,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
'metadataDriverImpl'
=>
new
AnnotationDriver
(),
'dqlClassAliasMap'
=>
array
(),
'cacheDir'
=>
null
,
'allowPartialObjects'
=>
true
'allowPartialObjects'
=>
true
,
'useCExtension'
=>
false
));
}
...
...
@@ -186,4 +187,14 @@ class Configuration extends \Doctrine\DBAL\Configuration
{
$this
->
_attributes
[
'metadataCacheImpl'
]
=
$cacheImpl
;
}
public
function
getUseCExtension
()
{
return
$this
->
_attributes
[
'useCExtension'
];
}
public
function
setUseCExtension
(
$boolean
)
{
$this
->
_attributes
[
'useCExtension'
]
=
$boolean
;
}
}
\ No newline at end of file
lib/Doctrine/ORM/UnitOfWork.php
View file @
1aeff68c
...
...
@@ -204,6 +204,13 @@ class UnitOfWork implements PropertyChangedListener
*/
private
$_collectionPersisters
=
array
();
/**
* Flag for whether or not to use the C extension for hydration
*
* @var string
*/
private
$_useCExtension
=
false
;
/**
* Initializes a new UnitOfWork instance, bound to the given EntityManager.
*
...
...
@@ -214,6 +221,7 @@ class UnitOfWork implements PropertyChangedListener
$this
->
_em
=
$em
;
//TODO: any benefit with lazy init?
$this
->
_commitOrderCalculator
=
new
CommitOrderCalculator
();
$this
->
_useCExtension
=
$this
->
_em
->
getConfiguration
()
->
getUseCExtension
();
}
/**
...
...
@@ -1334,9 +1342,13 @@ class UnitOfWork implements PropertyChangedListener
}
if
(
$overrideLocalChanges
)
{
foreach
(
$data
as
$field
=>
$value
)
{
if
(
isset
(
$class
->
reflFields
[
$field
]))
{
$class
->
reflFields
[
$field
]
->
setValue
(
$entity
,
$value
);
if
(
$this
->
_useCExtension
)
{
doctrine_populate_data
(
$entity
,
$data
);
}
else
{
foreach
(
$data
as
$field
=>
$value
)
{
if
(
isset
(
$class
->
reflFields
[
$field
]))
{
$class
->
reflFields
[
$field
]
->
setValue
(
$entity
,
$value
);
}
}
}
}
else
{
...
...
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