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
572f7281
Commit
572f7281
authored
Jan 21, 2010
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-260] Fixed/Corrected patch.
parent
37cb86fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
41 deletions
+25
-41
ClassMetadata.php
lib/Doctrine/ORM/Mapping/ClassMetadata.php
+20
-40
ClassMetadataFactory.php
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
+5
-1
No files found.
lib/Doctrine/ORM/Mapping/ClassMetadata.php
View file @
572f7281
...
...
@@ -144,14 +144,9 @@ class ClassMetadata extends ClassMetadataInfo
parent
::
_validateAndCompleteFieldMapping
(
$mapping
);
// Store ReflectionProperty of mapped field
try
{
$refProp
=
$this
->
reflClass
->
getProperty
(
$mapping
[
'fieldName'
]);
$refProp
->
setAccessible
(
true
);
$this
->
reflFields
[
$mapping
[
'fieldName'
]]
=
$refProp
;
}
catch
(
\ReflectionException
$e
)
{
throw
MappingException
::
reflectionFailure
(
$this
->
name
,
$e
);
}
$refProp
=
$this
->
reflClass
->
getProperty
(
$mapping
[
'fieldName'
]);
$refProp
->
setAccessible
(
true
);
$this
->
reflFields
[
$mapping
[
'fieldName'
]]
=
$refProp
;
}
/**
...
...
@@ -242,14 +237,9 @@ class ClassMetadata extends ClassMetadataInfo
// Store ReflectionProperty of mapped field
$sourceFieldName
=
$assocMapping
->
sourceFieldName
;
try
{
$refProp
=
$this
->
reflClass
->
getProperty
(
$sourceFieldName
);
$refProp
->
setAccessible
(
true
);
$this
->
reflFields
[
$sourceFieldName
]
=
$refProp
;
}
catch
(
\ReflectionException
$e
)
{
throw
MappingException
::
reflectionFailure
(
$this
->
name
,
$e
);
}
$refProp
=
$this
->
reflClass
->
getProperty
(
$sourceFieldName
);
$refProp
->
setAccessible
(
true
);
$this
->
reflFields
[
$sourceFieldName
]
=
$refProp
;
}
/**
...
...
@@ -352,11 +342,9 @@ class ClassMetadata extends ClassMetadataInfo
'isVersioned'
,
'lifecycleCallbacks'
,
'name'
,
//'namespace',
'parentClasses'
,
'primaryTable'
,
'rootEntityName'
,
//'sequenceGeneratorDefinition',
'subClasses'
,
'versionField'
);
...
...
@@ -373,33 +361,25 @@ class ClassMetadata extends ClassMetadataInfo
$this
->
reflClass
=
new
\ReflectionClass
(
$this
->
name
);
foreach
(
$this
->
fieldMappings
as
$field
=>
$mapping
)
{
try
{
if
(
isset
(
$mapping
[
'inherited'
]))
{
$reflField
=
new
\ReflectionProperty
(
$mapping
[
'inherited'
],
$field
);
}
else
{
$reflField
=
$this
->
reflClass
->
getProperty
(
$field
);
}
if
(
isset
(
$mapping
[
'inherited'
]))
{
$reflField
=
new
\ReflectionProperty
(
$mapping
[
'inherited'
],
$field
);
}
else
{
$reflField
=
$this
->
reflClass
->
getProperty
(
$field
);
}
$reflField
->
setAccessible
(
true
);
$this
->
reflFields
[
$field
]
=
$reflField
;
}
catch
(
\ReflectionException
$e
)
{
throw
MappingException
::
reflectionFailure
(
$this
->
name
,
$e
);
}
$reflField
->
setAccessible
(
true
);
$this
->
reflFields
[
$field
]
=
$reflField
;
}
foreach
(
$this
->
associationMappings
as
$field
=>
$mapping
)
{
try
{
if
(
isset
(
$this
->
inheritedAssociationFields
[
$field
]))
{
$reflField
=
new
\ReflectionProperty
(
$this
->
inheritedAssociationFields
[
$field
],
$field
);
}
else
{
$reflField
=
$this
->
reflClass
->
getProperty
(
$field
);
}
if
(
isset
(
$this
->
inheritedAssociationFields
[
$field
]))
{
$reflField
=
new
\ReflectionProperty
(
$this
->
inheritedAssociationFields
[
$field
],
$field
);
}
else
{
$reflField
=
$this
->
reflClass
->
getProperty
(
$field
);
}
$reflField
->
setAccessible
(
true
);
$this
->
reflFields
[
$field
]
=
$reflField
;
}
catch
(
\ReflectionException
$e
)
{
throw
MappingException
::
reflectionFailure
(
$this
->
name
,
$e
);
}
$reflField
->
setAccessible
(
true
);
$this
->
reflFields
[
$field
]
=
$reflField
;
}
//$this->prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
...
...
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
View file @
572f7281
...
...
@@ -222,7 +222,11 @@ class ClassMetadataFactory
}
// Invoke driver
$this
->
_driver
->
loadMetadataForClass
(
$className
,
$class
);
try
{
$this
->
_driver
->
loadMetadataForClass
(
$className
,
$class
);
}
catch
(
\ReflectionException
$e
)
{
throw
MappingException
::
reflectionFailure
(
$className
,
$e
);
}
// Verify & complete identifier mapping
if
(
!
$class
->
identifier
&&
!
$class
->
isMappedSuperclass
)
{
...
...
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