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
6b26a7b8
Commit
6b26a7b8
authored
Oct 08, 2007
by
adamthehutt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for ticket #457, moves Doctrine_Record::find/One() to Doctrine_Table::execute/One()
Ticket: 457
parent
f1162cd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
40 deletions
+42
-40
Record.php
lib/Doctrine/Record.php
+0
-39
Table.php
lib/Doctrine/Table.php
+41
-0
RegistryTestCase.php
tests/Query/RegistryTestCase.php
+1
-1
No files found.
lib/Doctrine/Record.php
View file @
6b26a7b8
...
...
@@ -1421,45 +1421,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
}
}
/**
* fetch
* fetches data using the provided queryKey and
* the associated query in the query registry
*
* if no query for given queryKey is being found a
* Doctrine_Query_Registry exception is being thrown
*
* @param string $queryKey the query key
* @param array $params prepared statement params (if any)
* @return mixed the fetched data
*/
public
function
find
(
$queryKey
,
$params
=
array
(),
$hydrationMode
=
Doctrine
::
HYDRATE_RECORD
)
{
return
Doctrine_Manager
::
getInstance
()
->
getQueryRegistry
()
->
get
(
$queryKey
,
$this
->
_table
->
getComponentName
())
->
execute
(
$params
,
$hydrationMode
);
}
/**
* fetchOne
* fetches data using the provided queryKey and
* the associated query in the query registry
*
* if no query for given queryKey is being found a
* Doctrine_Query_Registry exception is being thrown
*
* @param string $queryKey the query key
* @param array $params prepared statement params (if any)
* @return mixed the fetched data
*/
public
function
findOne
(
$queryKey
,
$params
=
array
(),
$hydrationMode
=
Doctrine
::
HYDRATE_RECORD
)
{
return
Doctrine_Manager
::
getInstance
()
->
getQueryRegistry
()
->
get
(
$queryKey
,
$this
->
_table
->
getComponentName
())
->
fetchOne
(
$params
,
$hydrationMode
);
}
/**
* call
*
...
...
lib/Doctrine/Table.php
View file @
6b26a7b8
...
...
@@ -886,6 +886,47 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
{
return
$this
->
findBySql
(
$dql
,
$params
,
$hydrationMode
);
}
/**
* execute
* fetches data using the provided queryKey and
* the associated query in the query registry
*
* if no query for given queryKey is being found a
* Doctrine_Query_Registry exception is being thrown
*
* @param string $queryKey the query key
* @param array $params prepared statement params (if any)
* @return mixed the fetched data
*/
public
function
execute
(
$queryKey
,
$params
=
array
(),
$hydrationMode
=
Doctrine
::
HYDRATE_RECORD
)
{
return
Doctrine_Manager
::
getInstance
()
->
getQueryRegistry
()
->
get
(
$queryKey
,
$this
->
getComponentName
())
->
execute
(
$params
,
$hydrationMode
);
}
/**
* executeOne
* fetches data using the provided queryKey and
* the associated query in the query registry
*
* if no query for given queryKey is being found a
* Doctrine_Query_Registry exception is being thrown
*
* @param string $queryKey the query key
* @param array $params prepared statement params (if any)
* @return mixed the fetched data
*/
public
function
executeOne
(
$queryKey
,
$params
=
array
(),
$hydrationMode
=
Doctrine
::
HYDRATE_RECORD
)
{
return
Doctrine_Manager
::
getInstance
()
->
getQueryRegistry
()
->
get
(
$queryKey
,
$this
->
getComponentName
())
->
fetchOne
(
$params
,
$hydrationMode
);
}
/**
* clear
* clears the first level cache (identityMap)
...
...
tests/Query/RegistryTestCase.php
View file @
6b26a7b8
...
...
@@ -62,6 +62,6 @@ class Doctrine_Query_Registry_TestCase extends Doctrine_UnitTestCase
$user
=
new
User
();
$user
->
find
(
'all'
);
$user
->
getTable
()
->
execute
(
'all'
);
}
}
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