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
7cf8d1ae
Commit
7cf8d1ae
authored
Feb 02, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-268 Added missing duplicateAssociationMapping() method to MappingException
parent
dcfb856d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
MappingException.php
lib/Doctrine/ORM/Mapping/MappingException.php
+4
-0
ClassMetadataTest.php
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
+11
-0
No files found.
lib/Doctrine/ORM/Mapping/MappingException.php
View file @
7cf8d1ae
...
...
@@ -152,6 +152,10 @@ class MappingException extends \Doctrine\ORM\ORMException
return
new
self
(
'Property "'
.
$fieldName
.
'" in "'
.
$entity
.
'" was already declared, but it must be declared only once'
);
}
public
static
function
duplicateAssociationMapping
(
$entity
,
$fieldName
)
{
return
new
self
(
'Property "'
.
$fieldName
.
'" in "'
.
$entity
.
'" was already declared, but it must be declared only once'
);
}
public
static
function
singleIdNotAllowedOnCompositePrimaryKey
(
$entity
)
{
return
new
self
(
'Single id is not allowed on composite primary key in entity '
.
$entity
);
}
...
...
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
View file @
7cf8d1ae
...
...
@@ -137,4 +137,15 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
$this
->
setExpectedException
(
'Doctrine\ORM\Mapping\MappingException'
);
$cm
->
getSingleIdentifierFieldName
();
}
public
function
testDuplicateAssociationMappingException
()
{
$cm
=
new
ClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsUser'
);
$a1
=
new
\Doctrine\ORM\Mapping\OneToOneMapping
(
array
(
'fieldName'
=>
'foo'
,
'sourceEntity'
=>
'stdClass'
,
'targetEntity'
=>
'stdClass'
,
'joinColumns'
=>
array
()));
$a2
=
new
\Doctrine\ORM\Mapping\OneToOneMapping
(
array
(
'fieldName'
=>
'foo'
,
'sourceEntity'
=>
'stdClass'
,
'targetEntity'
=>
'stdClass'
,
'joinColumns'
=>
array
()));
$cm
->
addAssociationMapping
(
$a1
);
$this
->
setExpectedException
(
'Doctrine\ORM\Mapping\MappingException'
);
$cm
->
addAssociationMapping
(
$a2
);
}
}
\ 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