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
4aa70a18
Commit
4aa70a18
authored
May 20, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
999c72bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
Parser.php
lib/Doctrine/Relation/Parser.php
+22
-11
No files found.
lib/Doctrine/Relation/Parser.php
View file @
4aa70a18
...
@@ -134,6 +134,12 @@ class Doctrine_Relation_Parser
...
@@ -134,6 +134,12 @@ class Doctrine_Relation_Parser
}
}
}
}
}
}
/**
* Completes the given association definition
*
* @param array $def definition array to be completed
* @return array completed definition array
*/
public
function
completeAssocDefinition
(
$def
)
public
function
completeAssocDefinition
(
$def
)
{
{
$conn
=
$this
->
_table
->
getConnection
();
$conn
=
$this
->
_table
->
getConnection
();
...
@@ -159,6 +165,15 @@ class Doctrine_Relation_Parser
...
@@ -159,6 +165,15 @@ class Doctrine_Relation_Parser
return
$def
;
return
$def
;
}
}
/**
* getIdentifiers
* gives a list of identifiers from given table
*
* the identifiers are in format:
* [componentName].[identifier]
*
* @param Doctrine_Table $table table object to retrieve identifiers from
*/
public
function
getIdentifiers
(
Doctrine_Table
$table
)
public
function
getIdentifiers
(
Doctrine_Table
$table
)
{
{
if
(
is_array
(
$table
->
getIdentifier
()))
{
if
(
is_array
(
$table
->
getIdentifier
()))
{
...
@@ -174,6 +189,12 @@ class Doctrine_Relation_Parser
...
@@ -174,6 +189,12 @@ class Doctrine_Relation_Parser
return
$columns
;
return
$columns
;
}
}
/**
* Completes the given definition
*
* @param array $def definition array to be completed
* @return array completed definition array
*/
public
function
completeDefinition
(
$def
)
public
function
completeDefinition
(
$def
)
{
{
$conn
=
$this
->
_table
->
getConnection
();
$conn
=
$this
->
_table
->
getConnection
();
...
@@ -261,14 +282,6 @@ class Doctrine_Relation_Parser
...
@@ -261,14 +282,6 @@ class Doctrine_Relation_Parser
unset
(
$definition
[
'field'
]);
unset
(
$definition
[
'field'
]);
$definition
[
'table'
]
=
$this
->
conn
->
getTable
(
$definition
[
'class'
],
$allowExport
);
$definition
[
'table'
]
=
$this
->
conn
->
getTable
(
$definition
[
'class'
],
$allowExport
);
$definition
[
'constraint'
]
=
false
;
// MANY-TO-MANY
// only aggregate relations allowed
if
(
$definition
[
'type'
]
!=
Doctrine_Relation
::
MANY_AGGREGATE
)
{
throw
new
Doctrine_Table_Exception
(
"Only aggregate relations are allowed for many-to-many relations"
);
}
$classes
=
array_merge
(
$this
->
options
[
'parents'
],
array
(
$this
->
options
[
'name'
]));
$classes
=
array_merge
(
$this
->
options
[
'parents'
],
array
(
$this
->
options
[
'name'
]));
...
@@ -282,9 +295,7 @@ class Doctrine_Relation_Parser
...
@@ -282,9 +295,7 @@ class Doctrine_Relation_Parser
throw
new
Doctrine_Table_Exception
(
"Couldn't map many-to-many relation for "
throw
new
Doctrine_Table_Exception
(
"Couldn't map many-to-many relation for "
.
$this
->
options
[
'name'
]
.
" and
$name
. Components use different join tables."
);
.
$this
->
options
[
'name'
]
.
" and
$name
. Components use different join tables."
);
}
}
if
(
!
isset
(
$definition
[
'local'
]))
{
$definition
[
'local'
]
=
$this
->
identifier
;
}
$e2
=
explode
(
'.'
,
$bound
[
'field'
]);
$e2
=
explode
(
'.'
,
$bound
[
'field'
]);
$fields
=
explode
(
'-'
,
$e2
[
1
]);
$fields
=
explode
(
'-'
,
$e2
[
1
]);
...
...
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