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
f11e9549
Commit
f11e9549
authored
Nov 15, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with data dumping. Added exception throwing when you use data key that does not exist.
parent
15bf4d70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
Export.php
lib/Doctrine/Data/Export.php
+1
-1
Import.php
lib/Doctrine/Data/Import.php
+13
-4
No files found.
lib/Doctrine/Data/Export.php
View file @
f11e9549
...
...
@@ -174,7 +174,7 @@ class Doctrine_Data_Export extends Doctrine_Data
$relationValue
=
$relationClassName
.
'_'
.
$value
;
$preparedData
[
$className
][
$recordKey
][
$relation
ClassName
]
=
$relationValue
;
$preparedData
[
$className
][
$recordKey
][
$relation
Alias
]
=
$relationValue
;
}
else
{
$preparedData
[
$className
][
$recordKey
][
$key
]
=
$value
;
}
...
...
lib/Doctrine/Data/Import.php
View file @
f11e9549
...
...
@@ -114,6 +114,15 @@ class Doctrine_Data_Import extends Doctrine_Data
}
}
protected
function
_getImportedObject
(
$rowKey
)
{
if
(
isset
(
$this
->
_importedObjects
[
$rowKey
]))
{
return
$this
->
_importedObjects
[
$rowKey
];
}
else
{
throw
new
Doctrine_Data_Exception
(
'Invalid row key specified: '
.
$rowKey
);
}
}
protected
function
_processRow
(
$rowKey
,
$row
)
{
$obj
=
$this
->
_importedObjects
[
$rowKey
];
...
...
@@ -130,18 +139,18 @@ class Doctrine_Data_Import extends Doctrine_Data
foreach
(
$value
as
$link
)
{
if
(
$obj
->
getTable
()
->
getRelation
(
$key
)
->
getType
()
===
Doctrine_Relation
::
ONE
)
{
$obj
->
set
(
$key
,
$this
->
_
importedObjects
[
$link
]
);
$obj
->
set
(
$key
,
$this
->
_
getImportedObject
(
$link
)
);
}
else
if
(
$obj
->
getTable
()
->
getRelation
(
$key
)
->
getType
()
===
Doctrine_Relation
::
MANY
)
{
$relation
=
$obj
->
$key
;
$relation
[]
=
$this
->
_
importedObjects
[
$link
]
;
$relation
[]
=
$this
->
_
getImportedObject
(
$link
)
;
}
}
}
else
{
$obj
->
$key
->
fromArray
(
$value
);
}
}
else
if
(
isset
(
$this
->
_importedObjects
[
$value
]))
{
$obj
->
set
(
$key
,
$this
->
_
importedObjects
[
$value
]
);
}
else
{
$obj
->
set
(
$key
,
$this
->
_
getImportedObject
(
$value
)
);
}
}
}
...
...
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