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
27356225
Commit
27356225
authored
Aug 24, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Updating YAML driver with missing elements from XML driver.
parent
05d5fe49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
XmlDriver.php
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+4
-1
YamlDriver.php
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
+21
-0
No files found.
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
View file @
27356225
...
...
@@ -67,7 +67,7 @@ class XmlDriver extends AbstractFileDriver
// Evaluate <unique-constraints..>
if
(
isset
(
$xmlRoot
->
{
'unique-constraints'
}))
{
foreach
(
$xmlRoot
->
{
'unique-constraints'
}
->
{
'unique-constraint'
}
as
$unique
)
{
$metadata
->
primaryTable
[
'uniqueConstraints'
][]
=
explode
(
','
,
$
index
[
'columns'
]);
$metadata
->
primaryTable
[
'uniqueConstraints'
][]
=
explode
(
','
,
$
unique
[
'columns'
]);
}
}
...
...
@@ -173,6 +173,9 @@ class XmlDriver extends AbstractFileDriver
$joinColumns
[]
=
$this
->
_getJoinColumnMapping
(
$manyToOneElement
->
{
'join-column'
});
}
else
if
(
isset
(
$manyToOneElement
->
{
'join-columns'
}))
{
foreach
(
$manyToOneElement
->
{
'join-columns'
}
->
{
'join-column'
}
as
$joinColumnElement
)
{
if
(
!
isset
(
$joinColumnElement
[
'name'
]))
{
$joinColumnElement
[
'name'
]
=
$name
;
}
$joinColumns
[]
=
$this
->
_getJoinColumnMapping
(
$joinColumnElement
);
}
}
else
{
...
...
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
View file @
27356225
...
...
@@ -57,6 +57,21 @@ class YamlDriver extends AbstractFileDriver
$metadata
->
setInheritanceType
(
$element
[
'inheritanceType'
]);
}
// Evaluate indexes
if
(
isset
(
$element
[
'indexes'
]))
{
foreach
(
$element
[
'indexes'
]
as
$index
)
{
$metadata
->
primaryTable
[
'indexes'
][
$index
[
'name'
]]
=
array
(
'fields'
=>
explode
(
','
,
$index
[
'columns'
]));
}
}
// Evaluate uniqueConstraints
if
(
isset
(
$element
[
'uniqueConstraints'
]))
{
foreach
(
$element
[
'uniqueConstraints'
]
as
$unique
)
{
$metadata
->
primaryTable
[
'uniqueConstraints'
][]
=
explode
(
','
,
$unique
[
'columns'
]);
}
}
// Evaluate fields
if
(
isset
(
$element
[
'fields'
]))
{
foreach
(
$element
[
'fields'
]
as
$name
=>
$fieldMapping
)
{
...
...
@@ -70,6 +85,12 @@ class YamlDriver extends AbstractFileDriver
if
(
isset
(
$fieldMapping
[
'length'
]))
{
$mapping
[
'length'
]
=
$fieldMapping
[
'length'
];
}
if
(
isset
(
$fieldMapping
[
'precision'
]))
{
$mapping
[
'precision'
]
=
$fieldMapping
[
'precision'
];
}
if
(
isset
(
$fieldMapping
[
'scale'
]))
{
$mapping
[
'scale'
]
=
$fieldMapping
[
'scale'
];
}
if
(
isset
(
$fieldMapping
[
'version'
])
&&
$fieldMapping
[
'version'
])
{
$metadata
->
setVersionMapping
(
$mapping
);
}
...
...
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