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
2e6d8a98
Commit
2e6d8a98
authored
May 21, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
a7d1d643
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
Record.php
lib/Doctrine/Record.php
+16
-16
No files found.
lib/Doctrine/Record.php
View file @
2e6d8a98
...
...
@@ -112,9 +112,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
protected
$_filter
;
/**
* @var array $
references
an array containing all the references
* @var array $
_references
an array containing all the references
*/
pr
ivate
$
references
=
array
();
pr
otected
$_
references
=
array
();
/**
* @var integer $index this index is used for creating object identifiers
*/
...
...
@@ -722,14 +722,14 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
try
{
if
(
!
isset
(
$this
->
references
[
$name
]))
{
if
(
!
isset
(
$this
->
_
references
[
$name
]))
{
$this
->
loadReference
(
$name
);
}
}
catch
(
Doctrine_Table_Exception
$e
)
{
throw
new
Doctrine_Record_Exception
(
"Unknown property / related component '
$name
'."
);
}
return
$this
->
references
[
$name
];
return
$this
->
_
references
[
$name
];
}
/**
* mapValue
...
...
@@ -841,7 +841,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
}
$this
->
references
[
$name
]
=
$value
;
$this
->
_
references
[
$name
]
=
$value
;
}
/**
* contains
...
...
@@ -859,7 +859,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if
(
isset
(
$this
->
_id
[
$lower
]))
{
return
true
;
}
if
(
isset
(
$this
->
references
[
$name
]))
{
if
(
isset
(
$this
->
_
references
[
$name
]))
{
return
true
;
}
return
false
;
...
...
@@ -904,8 +904,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$table
=
$fk
->
getTable
();
$alias
=
$this
->
_table
->
getAlias
(
$table
->
getComponentName
());
if
(
isset
(
$this
->
references
[
$alias
]))
{
$obj
=
$this
->
references
[
$alias
];
if
(
isset
(
$this
->
_
references
[
$alias
]))
{
$obj
=
$this
->
_
references
[
$alias
];
$obj
->
save
(
$conn
);
}
}
...
...
@@ -1139,7 +1139,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
public
function
copyDeep
(){
$copy
=
$this
->
copy
();
foreach
(
$this
->
references
as
$key
=>
$value
)
{
foreach
(
$this
->
_
references
as
$key
=>
$value
)
{
if
(
$value
instanceof
Doctrine_Collection
)
{
foreach
(
$value
as
$record
)
{
$copy
->
{
$key
}[]
=
$record
->
copyDeep
();
...
...
@@ -1218,7 +1218,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
hasReference
(
$name
)
{
return
isset
(
$this
->
references
[
$name
]);
return
isset
(
$this
->
_
references
[
$name
]);
}
/**
* obtainReference
...
...
@@ -1228,8 +1228,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
obtainReference
(
$name
)
{
if
(
isset
(
$this
->
references
[
$name
]))
{
return
$this
->
references
[
$name
];
if
(
isset
(
$this
->
_
references
[
$name
]))
{
return
$this
->
_
references
[
$name
];
}
throw
new
Doctrine_Record_Exception
(
"Unknown reference
$name
"
);
}
...
...
@@ -1239,7 +1239,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
getReferences
()
{
return
$this
->
references
;
return
$this
->
_
references
;
}
/**
* setRelated
...
...
@@ -1249,7 +1249,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
final
public
function
setRelated
(
$alias
,
Doctrine_Access
$coll
)
{
$this
->
references
[
$alias
]
=
$coll
;
$this
->
_
references
[
$alias
]
=
$coll
;
}
/**
* loadReference
...
...
@@ -1265,11 +1265,11 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$fk
=
$this
->
_table
->
getRelation
(
$name
);
if
(
$fk
->
isOneToOne
())
{
$this
->
references
[
$name
]
=
$fk
->
fetchRelatedFor
(
$this
);
$this
->
_
references
[
$name
]
=
$fk
->
fetchRelatedFor
(
$this
);
}
else
{
$coll
=
$fk
->
fetchRelatedFor
(
$this
);
$this
->
references
[
$name
]
=
$coll
;
$this
->
_
references
[
$name
]
=
$coll
;
}
}
/**
...
...
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