Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.7

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 (version 0.1.3)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-08-19 13:58 UTC] kenchou77 at gmail dot com (Ken)
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);

Comments

 [2006-08-23 14:05 UTC] wiesemann (Mark Wiesemann)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. --- Thanks for the request. I've optimized your patch suggestion a little bit, but your idea was right.