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
f6b334ea
Commit
f6b334ea
authored
Apr 04, 2012
by
Aigars Gedroics
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDO results with fetch style PDO::FETCH_COLUMN made available for caching
parent
394f7e9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
ArrayStatement.php
lib/Doctrine/DBAL/Cache/ArrayStatement.php
+5
-1
ResultCacheStatement.php
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
+2
-0
No files found.
lib/Doctrine/DBAL/Cache/ArrayStatement.php
View file @
f6b334ea
...
...
@@ -68,6 +68,10 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
return
array_values
(
$row
);
}
else
if
(
$fetchStyle
===
PDO
::
FETCH_BOTH
)
{
return
array_merge
(
$row
,
array_values
(
$row
));
}
else
if
(
$fetchStyle
===
PDO
::
FETCH_COLUMN
)
{
return
reset
(
$row
);
}
else
{
throw
new
\InvalidArgumentException
(
"Invalid fetch-style given for fetching result."
);
}
}
return
false
;
...
...
@@ -91,4 +95,4 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
}
return
$row
[
$columnIndex
];
}
}
\ No newline at end of file
}
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
View file @
f6b334ea
...
...
@@ -169,6 +169,8 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
return
array_values
(
$row
);
}
else
if
(
$fetchStyle
==
PDO
::
FETCH_BOTH
)
{
return
array_merge
(
$row
,
array_values
(
$row
));
}
else
if
(
$fetchStyle
==
PDO
::
FETCH_COLUMN
)
{
return
reset
(
$row
);
}
else
{
throw
new
\InvalidArgumentException
(
"Invalid fetch-style given for caching result."
);
}
...
...
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