Extending Zend DB Table to include BETWEEN and LIMIT.

Posted by davykiash on Stack Overflow See other posts from Stack Overflow or by davykiash
Published on 2010-06-10T08:15:38Z Indexed on 2010/06/10 8:22 UTC
Read the original article Hit count: 289

Filed under:
|

Am looking for how I can extend the Zend_DB_Table below to accomodate a BETWEEN two dates syntax and LIMIT syntax

My current construct is

class Model_DbTable_Tablelist extends Zend_Db_Table_Abstract
{
    protected $_name = 'mytable';

    $select = $this->select()
                    ->setIntegrityCheck(false)
                    ->from('mytable',
                        array('MyCol1', 'MyDate'));

}

I want it extended to be equivalent to the query below

SELECT MyCol1,MyDate FROM mytable
WHERE MyDate BETWEEN '2008-04-03' AND '2009-01-02'
LIMIT 0,20

Any ideas?

© Stack Overflow or respective owner

Related posts about sql

Related posts about zend-db