Home » Structures » Structures_DataGrid_DataSource_DBTable » Bug #8512
need 'params' in bind() options
Details
| Request #8512 | need 'params' in bind() options |
|---|---|
| Submitted | 2006-08-19 13:58 UTC |
| From | kenchou77 at gmail dot com |
| Assigned | wiesemann |
| Status | Closed |
| Package | Structures_DataGrid_DataSource_DBTable |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2006-08-19 13:58 UTC] kenchou77 at gmail dot com
Description:
------------
when sql use placeholder,need params. DB_Table has this feature,but Structures_DataGrid_DataSource_DBTable ignore it.
change code: function &fetch() and function count()
1.function &fetch
if (!isset($this->_options['params'])
|| empty($this->_options['params'])) {
$this->_result = $this->_object->selectResult(
$this->_options['view'],
$this->_options['where'],
$sortString,
$offset, $limit);
}else {
$this->_result = $this->_object->selectResult(
$this->_options['view'],
$this->_options['where'],
$sortString,
$offset, $limit,
$this->_options['params']);
}
2.function count()
if (!isset($this->_options['params'])
|| empty($this->_options['params'])) {
return $this->_object->selectCount($this->_options['view'],
$this->_options['where']);
}else {
return $this->_object->selectCount($this->_options['view'],
$this->_options['where'],
NULL,
NULL,
NULL,
$this->_options['params']);
}
Test script:
---------------
example:
$filter = 'email=:email';
$params = array('email'=>'who@where.net');
$datagrid->bind($dataObject, array('view' =>'list', 'where' => $filter, 'params' => $params);