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
2e3f8002
Commit
2e3f8002
authored
Sep 04, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed indexGenerator
parent
b340bfe1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
43 deletions
+16
-43
IndexGenerator.php
Doctrine/IndexGenerator.php
+0
-25
Record.php
Doctrine/Record.php
+16
-18
No files found.
Doctrine/IndexGenerator.php
deleted
100644 → 0
View file @
b340bfe1
<?php
class
Doctrine_IndexGenerator
{
/**
* @var string $name
*/
private
$name
;
/**
* @param string $name
*/
public
function
__construct
(
$name
)
{
$this
->
name
=
$name
;
}
/**
* @param Doctrine_Record $record
* @return mixed
*/
public
function
getIndex
(
Doctrine_Record
$record
)
{
$value
=
$record
->
get
(
$this
->
name
);
if
(
$value
===
null
)
throw
new
Doctrine_Exception
(
"Couldn't create collection index. Record field '"
.
$this
->
name
.
"' was null."
);
return
$value
;
}
}
Doctrine/Record.php
View file @
2e3f8002
...
@@ -800,26 +800,24 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -800,26 +800,24 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
foreach
(
$array
as
$k
=>
$v
)
{
foreach
(
$array
as
$k
=>
$v
)
{
$type
=
$this
->
table
->
getTypeOf
(
$v
);
$type
=
$this
->
table
->
getTypeOf
(
$v
);
if
(
$type
==
'array'
||
switch
(
$type
)
{
$type
==
'object'
)
{
case
'array'
:
case
'object'
:
$a
[
$v
]
=
serialize
(
$this
->
data
[
$v
]);
break
;;
case
'enum'
$a
[
$v
]
=
$this
->
table
->
enumIndex
(
$v
,
$this
->
data
[
$v
]);
break
;
default
:
if
(
$this
->
data
[
$v
]
instanceof
Doctrine_Record
)
$this
->
data
[
$v
]
=
$this
->
data
[
$v
]
->
getIncremented
();
$a
[
$v
]
=
serialize
(
$this
->
data
[
$v
]);
continue
;
}
elseif
(
$type
==
'enum'
)
{
$a
[
$v
]
=
$this
->
table
->
enumIndex
(
$v
,
$this
->
data
[
$v
]);
continue
;
}
if
(
$this
->
data
[
$v
]
instanceof
Doctrine_Record
)
{
$this
->
data
[
$v
]
=
$this
->
data
[
$v
]
->
getIncremented
();
}
if
(
$this
->
data
[
$v
]
===
self
::
$null
)
if
(
$this
->
data
[
$v
]
===
self
::
$null
)
$a
[
$v
]
=
null
;
$a
[
$v
]
=
null
;
else
else
$a
[
$v
]
=
$this
->
data
[
$v
];
$a
[
$v
]
=
$this
->
data
[
$v
];
}
}
}
foreach
(
$this
->
table
->
getInheritanceMap
()
as
$k
=>
$v
)
{
foreach
(
$this
->
table
->
getInheritanceMap
()
as
$k
=>
$v
)
{
...
...
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