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
fd89892c
Commit
fd89892c
authored
Aug 24, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Updating YAML and XML drivers to be synchronized with Annotations driver.
parent
27356225
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
423 additions
and
324 deletions
+423
-324
doctrine-mapping.xsd
doctrine-mapping.xsd
+5
-5
AnnotationDriver.php
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
+0
-6
XmlDriver.php
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+209
-154
YamlDriver.php
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
+190
-154
MappingDriverTest.php
tests/Doctrine/Tests/ORM/Mapping/MappingDriverTest.php
+12
-0
Doctrine.Tests.ORM.Mapping.User.dcm.xml
...s/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
+3
-4
Doctrine.Tests.ORM.Mapping.User.dcm.yml
.../ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml
+4
-1
No files found.
doctrine-mapping.xsd
View file @
fd89892c
...
...
@@ -33,7 +33,7 @@
</xs:sequence>
</xs:complexType>
<xs:simpleType
name=
"lifecycle-
callback
-type"
>
<xs:simpleType
name=
"lifecycle-
listener
-type"
>
<xs:restriction
base=
"xs:token"
>
<xs:enumeration
value=
"prePersist"
/>
<xs:enumeration
value=
"postPersist"
/>
...
...
@@ -45,14 +45,14 @@
</xs:restriction>
</xs:simpleType>
<xs:complexType
name=
"lifecycle-
callback
"
>
<xs:attribute
name=
"type"
type=
"orm:lifecycle-
callback
-type"
use=
"required"
/>
<xs:complexType
name=
"lifecycle-
listener
"
>
<xs:attribute
name=
"type"
type=
"orm:lifecycle-
listener
-type"
use=
"required"
/>
<xs:attribute
name=
"method"
type=
"xs:NMTOKEN"
use=
"required"
/>
</xs:complexType>
<xs:complexType
name=
"lifecycle-
callbacks
"
>
<xs:complexType
name=
"lifecycle-
listener
"
>
<xs:sequence>
<xs:element
name=
"lifecycle-
callback"
type=
"orm:lifecycle-callback
"
minOccurs=
"1"
maxOccurs=
"unbounded"
/>
<xs:element
name=
"lifecycle-
listener"
type=
"orm:lifecycle-listener
"
minOccurs=
"1"
maxOccurs=
"unbounded"
/>
</xs:sequence>
</xs:complexType>
...
...
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
View file @
fd89892c
...
...
@@ -112,12 +112,6 @@ class AnnotationDriver implements Driver
$metadata
->
setDiscriminatorMap
(
$discrMapAnnot
->
value
);
}
// Evaluate DoctrineSubClasses annotation
if
(
isset
(
$classAnnotations
[
'Doctrine\ORM\Mapping\SubClasses'
]))
{
$subClassesAnnot
=
$classAnnotations
[
'Doctrine\ORM\Mapping\SubClasses'
];
$metadata
->
setSubclasses
(
$subClassesAnnot
->
value
);
}
// Evaluate DoctrineChangeTrackingPolicy annotation
if
(
isset
(
$classAnnotations
[
'Doctrine\ORM\Mapping\ChangeTrackingPolicy'
]))
{
$changeTrackingAnnot
=
$classAnnotations
[
'Doctrine\ORM\Mapping\ChangeTrackingPolicy'
];
...
...
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
View file @
fd89892c
This diff is collapsed.
Click to expand it.
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
View file @
fd89892c
This diff is collapsed.
Click to expand it.
tests/Doctrine/Tests/ORM/Mapping/MappingDriverTest.php
View file @
fd89892c
...
...
@@ -97,6 +97,9 @@ class MappingDriverTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertTrue
(
$class
->
associationMappings
[
'groups'
]
instanceof
\Doctrine\ORM\Mapping\ManyToManyMapping
);
$this
->
assertTrue
(
isset
(
$class
->
associationMappings
[
'groups'
]));
$this
->
assertTrue
(
$class
->
associationMappings
[
'groups'
]
->
isOwningSide
);
$this
->
assertEquals
(
count
(
$class
->
lifecycleCallbacks
),
2
);
$this
->
assertEquals
(
$class
->
lifecycleCallbacks
[
'prePersist'
][
0
],
'doStuffOnPrePersist'
);
$this
->
assertEquals
(
$class
->
lifecycleCallbacks
[
'postPersist'
][
0
],
'doStuffOnPostPersist'
);
}
}
...
...
@@ -108,4 +111,13 @@ class User {
private
$groups
;
// ... rest of code omitted, irrelevant for the mapping tests
public
function
doStuffOnPrePersist
()
{
}
public
function
doStuffOnPostPersist
()
{
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
View file @
fd89892c
...
...
@@ -7,10 +7,9 @@
<entity
name=
"Doctrine\Tests\ORM\Mapping\User"
table=
"cms_users"
>
<lifecycle-callbacks>
<lifecycle-callback
type=
"prePersist"
method=
"onPrePersist"
/>
</lifecycle-callbacks>
<lifecycle-listener
method=
"doStuffOnPrePersist"
type=
"prePersist"
/>
<lifecycle-listener
method=
"doStuffOnPostPersist"
type=
"postPersist"
/>
<id
name=
"id"
type=
"integer"
column=
"id"
>
<generator
strategy=
"AUTO"
/>
</id>
...
...
tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml
View file @
fd89892c
...
...
@@ -31,4 +31,7 @@ Doctrine\Tests\ORM\Mapping\User:
referencedColumnName
:
id
inverseJoinColumns
:
group_id
:
referencedColumnName
:
id
\ No newline at end of file
referencedColumnName
:
id
lifecycleListeners
:
doStuffOnPrePersist
:
prePersist
doStuffOnPostPersist
:
postPersist
\ 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