Home » HTML » Pager » Bug #5605
Add DBDO::getLinks() to Pager_Wrapper_DBDO()
Details
| Request #5605 | Add DBDO::getLinks() to Pager_Wrapper_DBDO() |
|---|---|
| Submitted | 2005-10-04 23:52 UTC |
| From | norbert_m at php dot net |
| Assigned | quipo |
| Status | Closed |
| Package | Pager |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-10-04 23:52 UTC] norbert_m at php dot net
Description:
------------
This applies to Pager_Wrapper.php function Pager_Wrapper_DBDO().
Would you mind adding $db->getLinks(); to Pager_Wrapper.php r1.20 before line 262?
If you have links set up for the table, it loads them automatically. It doesn't bother anyone if no links are defined.
You might want to consider to add an optional $fetchLinks = false function parameter (to keep BC and to provide flexibility).
So the modified lines:
function Pager_Wrapper_DBDO(&$db, $pager_options = array(), $disabled = false, $fetchLinks = false)
while ($db->fetch()) {
if ($fetchLinks) {
$db->getLinks();
}
$page['data'][] = $db->toArray('%s', true);
}
Also, you might want to consider renaming $db to $do in this function to be consistent with the DB_DataObject documentation and examples, where all DataObjects are called $do. Because this variable is only accessable inside the function, it won't break BC.