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
4685a9ab
Commit
4685a9ab
authored
Feb 23, 2010
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-355] Fixed. Patch provided by Christian Heinrich.
parent
cbad4bff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
102 deletions
+122
-102
ClassMetadataInfo.php
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
+88
-83
MappingException.php
lib/Doctrine/ORM/Mapping/MappingException.php
+34
-19
No files found.
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
View file @
4685a9ab
...
...
@@ -1435,11 +1435,16 @@ class ClassMetadataInfo
$this
->
discriminatorMap
[
$value
]
=
$className
;
if
(
$this
->
name
==
$className
)
{
$this
->
discriminatorValue
=
$value
;
}
else
if
(
is_subclass_of
(
$className
,
$this
->
name
))
{
}
else
{
if
(
!
class_exists
(
$className
))
{
throw
MappingException
::
invalidClassInDiscriminatorMap
(
$className
,
$this
->
name
);
}
if
(
is_subclass_of
(
$className
,
$this
->
name
))
{
$this
->
subClasses
[]
=
$className
;
}
}
}
}
/**
* Gets the discriminator value of this class.
...
...
lib/Doctrine/ORM/Mapping/MappingException.php
View file @
4685a9ab
...
...
@@ -170,4 +170,19 @@ class MappingException extends \Doctrine\ORM\ORMException
{
return
new
self
(
'The annotation driver needs to have a directory path'
);
}
/**
* Throws an exception that indicates that a class used in a discriminator map does not exist.
* An example would be an outdated (maybe renamed) classname.
*
* @param string $className The class that could not be found
* @param string $owningClass The class that declares the discriminator map.
* @return self
*/
public
static
function
invalidClassInDiscriminatorMap
(
$invalidClass
,
$owningClass
)
{
return
new
self
(
"Entity class '
$className
' used in the discriminator map of class '
$owningClass
' "
.
"does not exist."
);
}
}
\ No newline at end of file
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