Archive for the 'Zend Framework' Category

Traits for PHP

Monday, March 17th, 2008

Via blog, found a link to a proposal for Traits in PHP. I wasn’t familiar with the practice, but as I read the proposal it struck a cord with me. I have been grappling with how to reuse certain functionality throughout disparate classes.
I looked at Mixins, which I also have been playing around with […]

Order By On findManyToManyRowset method for Zend Framework

Monday, February 18th, 2008

Select statements (via Zend_Db_Table_Select) can now be passed into the findManyToManyRowset method of Zend_Db_Table_Row_Abstract. In ZF 1.0, I couldn’t order my result sets coming back from MySQL, which was a pain. Now, I can use the following code, where $m is a Row object:

<?php$select = $m->select()->order(array(’startDate DESC’,‘endDate ASC’));
$tripreportRowset = $m->findManyToManyRowset(‘Tripreport’, ‘TripreportMountain’,NULL,NULL,$select);
?>

If you don’t need to order by multiple columns, then don’t pass […]