Zend_Paginator Without Adapter Data

If you simply want to take advantage of Zend_Paginators page generation function without feeding it actual data, how do you do it? Simple, implement Zend_Paginator_Adapter_Interface in your custom class and override three functions like below: <?php class Dotmanila_Paginator_Adapter_Null implements Zend_Paginator_Adapter_Interface { private $_count = 0; public function __construct(array $data) { if(isset($data['count']) AND $data['count'] > 0) …

Continue reading

Optimizing OR’ed WHERE Clauses Between JOIN’ed Tables

OR conditions are normally difficult to optimize when used on different columns, a pain when the columns are of range conditions and worst when done between 2 or more different tables. Look at my example below, the original query  is trying to find rows which conditions are based on columns from the JOIN’ed tables. mysql …

Continue reading