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
0686aef2
Commit
0686aef2
authored
Aug 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
714a4223
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
73 deletions
+71
-73
Table.php
lib/Doctrine/Table.php
+71
-73
No files found.
lib/Doctrine/Table.php
View file @
0686aef2
...
...
@@ -205,6 +205,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
// create database table
if
(
method_exists
(
$record
,
'setTableDefinition'
))
{
$record
->
setTableDefinition
();
// get the declaring class of setTableDefinition method
$method
=
new
ReflectionMethod
(
$this
->
options
[
'name'
],
'setTableDefinition'
);
$class
=
$method
->
getDeclaringClass
();
}
else
{
$class
=
new
ReflectionClass
(
$class
);
}
$this
->
options
[
'declaringClass'
]
=
$class
;
// set the table definition for the given tree implementation
if
(
$this
->
isTree
())
{
...
...
@@ -213,16 +220,10 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$this
->
columnCount
=
count
(
$this
->
columns
);
if
(
isset
(
$this
->
columns
))
{
// get the declaring class of setTableDefinition method
$method
=
new
ReflectionMethod
(
$this
->
options
[
'name'
],
'setTableDefinition'
);
$class
=
$method
->
getDeclaringClass
();
$this
->
options
[
'declaringClass'
]
=
$class
;
if
(
!
isset
(
$this
->
options
[
'tableName'
]))
{
$this
->
options
[
'tableName'
]
=
Doctrine
::
tableize
(
$class
->
getName
());
}
switch
(
count
(
$this
->
primaryKeys
))
{
case
0
:
$this
->
columns
=
array_merge
(
array
(
'id'
=>
...
...
@@ -283,10 +284,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
}
}
}
}
}
else
{
throw
new
Doctrine_Table_Exception
(
"Class '
$name
' has no table definition."
);
}
$record
->
setUp
();
...
...
@@ -895,7 +893,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
public
function
findAll
()
{
$graph
=
new
Doctrine_Query
(
$this
->
conn
);
$users
=
$graph
->
query
(
"FROM "
.
$this
->
options
[
'name'
]);
$users
=
$graph
->
query
(
'FROM '
.
$this
->
options
[
'name'
]);
return
$users
;
}
/**
...
...
@@ -1047,12 +1045,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
if
(
$id
!==
null
)
{
$query
=
'SELECT '
.
implode
(
', '
,
$this
->
primaryKeys
)
.
' FROM '
.
$this
->
getTableName
()
.
' WHERE '
.
implode
(
' = ? && '
,
$this
->
primaryKeys
)
.
' = ?'
;
.
' WHERE '
.
implode
(
' = ? && '
,
$this
->
primaryKeys
)
.
' = ?'
;
$query
=
$this
->
applyInheritance
(
$query
);
$params
=
array_merge
(
array
(
$id
),
array_values
(
$this
->
options
[
'inheritanceMap'
]));
$this
->
data
=
$this
->
conn
->
execute
(
$query
,
$params
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
$this
->
data
=
$this
->
conn
->
execute
(
$query
,
$params
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
if
(
$this
->
data
===
false
)
return
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