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
18115c77
Commit
18115c77
authored
Jul 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
0debccfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
13 deletions
+26
-13
Parser.php
lib/Doctrine/Relation/Parser.php
+23
-10
Table.php
lib/Doctrine/Table.php
+3
-3
No files found.
lib/Doctrine/Relation/Parser.php
View file @
18115c77
...
...
@@ -74,6 +74,15 @@ class Doctrine_Relation_Parser
return
$this
->
_pending
[
$name
];
}
public
function
hasRelation
(
$name
)
{
if
(
!
isset
(
$this
->
_pending
[
$name
])
&&
!
isset
(
$this
->
_relations
[
$name
]))
{
return
false
;
}
return
true
;
}
/**
* binds a relation
*
...
...
@@ -190,17 +199,21 @@ class Doctrine_Relation_Parser
if
(
!
isset
(
$this
->
_pending
[
$def
[
'refClass'
]])
&&
!
isset
(
$this
->
_relations
[
$def
[
'refClass'
]]))
{
$def
[
'refTable'
]
->
getRelationParser
()
->
bind
(
$this
->
_table
->
getComponentName
(),
array
(
'type'
=>
Doctrine_Relation
::
ONE
,
'local'
=>
$def
[
'local'
],
'foreign'
=>
$this
->
_table
->
getIdentifier
(),
'localKey'
=>
true
,
));
$this
->
bind
(
$def
[
'refClass'
],
array
(
'type'
=>
Doctrine_Relation
::
MANY
,
'foreign'
=>
$def
[
'local'
],
'local'
=>
$this
->
_table
->
getIdentifier
()));
$parser
=
$def
[
'refTable'
]
->
getRelationParser
();
if
(
!
$parser
->
hasRelation
(
$this
->
_table
->
getComponentName
()))
{
$parser
->
bind
(
$this
->
_table
->
getComponentName
(),
array
(
'type'
=>
Doctrine_Relation
::
ONE
,
'local'
=>
$def
[
'local'
],
'foreign'
=>
$this
->
_table
->
getIdentifier
(),
'localKey'
=>
true
,
));
}
if
(
!
$this
->
hasRelation
(
$def
[
'refClass'
]))
{
$this
->
bind
(
$def
[
'refClass'
],
array
(
'type'
=>
Doctrine_Relation
::
MANY
,
'foreign'
=>
$def
[
'local'
],
'local'
=>
$this
->
_table
->
getIdentifier
()));
}
}
if
(
in_array
(
$def
[
'class'
],
$localClasses
))
{
$rel
=
new
Doctrine_Relation_Nest
(
$def
);
...
...
lib/Doctrine/Table.php
View file @
18115c77
...
...
@@ -211,8 +211,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
if
(
isset
(
$this
->
columns
))
{
// get the declaring class of setTableDefinition method
$method
=
new
ReflectionMethod
(
$this
->
options
[
'name'
],
'setTableDefinition'
);
$class
=
$method
->
getDeclaringClass
();
$method
=
new
ReflectionMethod
(
$this
->
options
[
'name'
],
'setTableDefinition'
);
$class
=
$method
->
getDeclaringClass
();
$this
->
options
[
'declaringClass'
]
=
$class
;
...
...
@@ -364,7 +364,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
if
(
$relation
instanceof
Doctrine_Relation_LocalKey
)
{
$def
=
array
(
'local'
=>
$relation
->
getLocal
(),
'foreign'
=>
$
this
->
getIdentifier
(),
'foreign'
=>
$
relation
->
getForeign
(),
'foreignTable'
=>
$relation
->
getTable
()
->
getTableName
());
if
((
$key
=
array_search
(
$def
,
$options
[
'foreignKeys'
]))
===
false
)
{
...
...
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