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
d4c12c35
Commit
d4c12c35
authored
May 31, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new DQL Hydration algorithm !
parent
881788f3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
160 additions
and
230 deletions
+160
-230
Statement.php
lib/Doctrine/Db/Statement.php
+1
-1
Hydrate.php
lib/Doctrine/Hydrate.php
+116
-220
Array.php
lib/Doctrine/Hydrate/Array.php
+1
-1
Record.php
lib/Doctrine/Hydrate/Record.php
+3
-5
Query.php
lib/Doctrine/Query.php
+2
-1
Abstract.php
lib/Doctrine/Query/Abstract.php
+13
-0
Record.php
lib/Doctrine/Record.php
+9
-0
Table.php
lib/Doctrine/Table.php
+15
-2
No files found.
lib/Doctrine/Db/Statement.php
View file @
d4c12c35
...
...
@@ -201,7 +201,7 @@ class Doctrine_Db_Statement implements Doctrine_Adapter_Statement_Interface
public
function
execute
(
$params
=
null
)
{
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Db_Event
::
EXECUTE
,
$this
->
stmt
->
queryString
,
$params
);
//print $this->stmt->queryString . print_r($params, true) . "<br>";
//
print $this->stmt->queryString . print_r($params, true) . "<br>";
$skip
=
$this
->
adapter
->
getListener
()
->
onPreExecute
(
$event
);
if
(
!
$skip
)
{
...
...
lib/Doctrine/Hydrate.php
View file @
d4c12c35
This diff is collapsed.
Click to expand it.
lib/Doctrine/Hydrate/Array.php
View file @
d4c12c35
...
...
@@ -43,7 +43,7 @@ class Doctrine_Hydrate_Array
}
public
function
isIdentifiable
(
array
$data
,
Doctrine_Table
$table
)
{
return
true
;
return
(
!
empty
(
$data
))
;
}
public
function
registerCollection
(
$coll
)
{
...
...
lib/Doctrine/Hydrate/Record.php
View file @
d4c12c35
...
...
@@ -46,7 +46,7 @@ class Doctrine_Hydrate_Record
return
$coll
;
}
public
function
registerCollection
(
$coll
)
public
function
registerCollection
(
Doctrine_Collection
$coll
)
{
$this
->
_collections
[]
=
$coll
;
}
...
...
@@ -76,18 +76,16 @@ class Doctrine_Hydrate_Record
}
return
true
;
}
public
function
getElement
(
array
$data
,
$component
)
{
if
(
!
isset
(
$this
->
_tables
[
$component
]))
{
$this
->
_tables
[
$component
]
=
Doctrine_Manager
::
getInstance
()
->
getTable
(
$component
);
$this
->
_tables
[
$component
]
->
setAttribute
(
Doctrine
::
ATTR_LOAD_REFERENCES
,
false
);
}
$this
->
_tables
[
$component
]
->
setData
(
$data
);
$record
=
$this
->
_tables
[
$component
]
->
getRecord
();
$this
->
_records
[]
=
$record
;
$this
->
_tables
[
$component
]
->
setAttribute
(
Doctrine
::
ATTR_LOAD_REFERENCES
,
false
);
return
$record
;
}
...
...
lib/Doctrine/Query.php
View file @
d4c12c35
...
...
@@ -233,7 +233,8 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
* @return Doctrine_Query this object
*/
public
function
parseQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
)
{
{
// sanity check
if
(
$queryPart
===
''
||
$queryPart
===
null
)
{
throw
new
Doctrine_Query_Exception
(
'Empty '
.
$queryPartName
.
' part given.'
);
...
...
lib/Doctrine/Query/Abstract.php
View file @
d4c12c35
...
...
@@ -288,4 +288,17 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
{
return
$this
->
parseQueryPart
(
'offset'
,
$offset
);
}
/**
* parseQueryPart
* parses given DQL query part
*
* @param string $queryPartName the name of the query part
* @param string $queryPart query part to be parsed
* @param boolean $append whether or not to append the query part to its stack
* if false is given, this method will overwrite
* the given query part stack with $queryPart
* @return Doctrine_Query this object
*/
abstract
public
function
parseQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
);
}
lib/Doctrine/Record.php
View file @
d4c12c35
...
...
@@ -229,6 +229,15 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
{
return
self
::
$_null
;
}
/**
* _index
*
* @return integer
*/
public
static
function
_index
()
{
return
self
::
$_index
;
}
/**
* setUp
* this method is used for setting up relations and attributes
...
...
lib/Doctrine/Table.php
View file @
d4c12c35
...
...
@@ -857,13 +857,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$key
=
array
(
$key
);
}
$found
=
false
;
foreach
(
$key
as
$k
)
{
if
(
!
isset
(
$this
->
data
[
$k
]))
{
throw
new
Doctrine_Table_Exception
(
"Primary key value for
$k
wasn't found"
);
// primary key column not found return new record
$found
=
true
;
break
;
}
$id
[]
=
$this
->
data
[
$k
];
}
if
(
$found
)
{
$this
->
data
=
array
();
$recordName
=
$this
->
getClassnameToReturn
();
$record
=
new
$recordName
(
$this
,
true
);
return
$record
;
}
$id
=
implode
(
' '
,
$id
);
if
(
isset
(
$this
->
identityMap
[
$id
]))
{
...
...
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