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
d1047adb
Commit
d1047adb
authored
Sep 18, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inheritance bug fix
parent
f2a2d3e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
Table.php
Doctrine/Table.php
+9
-6
No files found.
Doctrine/Table.php
View file @
d1047adb
...
@@ -133,8 +133,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
...
@@ -133,8 +133,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
/**
/**
* the constructor
* the constructor
* @throws Doctrine_
ManagerException
if there are no opened connections
* @throws Doctrine_
Connection_Exception
if there are no opened connections
* @throws Doctrine_Table
Exception
if there is already an instance of this table
* @throws Doctrine_Table
_Exception
if there is already an instance of this table
* @return void
* @return void
*/
*/
public
function
__construct
(
$name
)
{
public
function
__construct
(
$name
)
{
...
@@ -156,7 +156,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
...
@@ -156,7 +156,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
// get parent classes
// get parent classes
do
{
do
{
if
(
$class
==
"Doctrine_Record"
)
break
;
if
(
$class
==
"Doctrine_Record"
)
break
;
$name
=
$class
;
$name
=
$class
;
$names
[]
=
$name
;
$names
[]
=
$name
;
...
@@ -172,6 +173,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
...
@@ -172,6 +173,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
$this
->
columnCount
=
count
(
$this
->
columns
);
$this
->
columnCount
=
count
(
$this
->
columns
);
if
(
isset
(
$this
->
columns
))
{
if
(
isset
(
$this
->
columns
))
{
// get the declaring class of setTableDefinition method
$method
=
new
ReflectionMethod
(
$this
->
name
,
"setTableDefinition"
);
$method
=
new
ReflectionMethod
(
$this
->
name
,
"setTableDefinition"
);
$class
=
$method
->
getDeclaringClass
();
$class
=
$method
->
getDeclaringClass
();
...
@@ -626,7 +629,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
...
@@ -626,7 +629,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
}
else
}
else
throw
new
Doctrine_Table_Exception
(
"Only one-to-one relations are possible when local reference key is used."
);
throw
new
Doctrine_Table_Exception
(
"Only one-to-one relations are possible when local reference key is used."
);
}
elseif
(
$component
==
$name
||
(
$component
==
$alias
&&
$name
==
$this
->
name
))
{
}
elseif
(
$component
==
$name
||
(
$component
==
$alias
&&
(
$name
==
$this
->
name
||
in_array
(
$name
,
$this
->
parents
)
))
{
if
(
!
isset
(
$local
))
if
(
!
isset
(
$local
))
$local
=
$this
->
identifier
;
$local
=
$this
->
identifier
;
...
@@ -668,8 +671,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
...
@@ -668,8 +671,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
}
else
{
}
else
{
// auto initialize a new one-to-one relationship for association table
// auto initialize a new one-to-one relationship for association table
$associationTable
->
bind
(
$this
->
getComponentName
(),
$associationTable
->
getComponentName
()
.
'.'
.
$e2
[
1
],
Doctrine_Relation
::
ONE_AGGREGATE
,
'id'
);
$associationTable
->
bind
(
$this
->
getComponentName
(),
$associationTable
->
getComponentName
()
.
'.'
.
$e2
[
1
],
Doctrine_Relation
::
ONE_AGGREGATE
,
'id'
);
$associationTable
->
bind
(
$table
->
getComponentName
(),
$associationTable
->
getComponentName
()
.
'.'
.
$foreign
,
Doctrine_Relation
::
ONE_AGGREGATE
,
'id'
);
$associationTable
->
bind
(
$table
->
getComponentName
(),
$associationTable
->
getComponentName
()
.
'.'
.
$foreign
,
Doctrine_Relation
::
ONE_AGGREGATE
,
'id'
);
// NORMAL MANY-TO-MANY RELATIONSHIP
// NORMAL MANY-TO-MANY RELATIONSHIP
$this
->
relations
[
$e2
[
0
]]
=
new
Doctrine_ForeignKey
(
$associationTable
,
$local
,
$e2
[
1
],
Doctrine_Relation
::
MANY_COMPOSITE
,
$e2
[
0
]);
$this
->
relations
[
$e2
[
0
]]
=
new
Doctrine_ForeignKey
(
$associationTable
,
$local
,
$e2
[
1
],
Doctrine_Relation
::
MANY_COMPOSITE
,
$e2
[
0
]);
...
...
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