[dev] Recent RDO changes

Chuck Hagenbuch chuck at horde.org
Fri Nov 24 15:27:08 PST 2006


Quoting Michael Rubinsky <mike at theupstairsroom.com>:

> ...and am I also correct in the fact the from outside the RDO  
> classes,  where I used to be able to do a ->queryOne() like this:
>
> <code>
> $query = Horde_RDO_Query::create(array('owner_id' => Auth::getAuth()), $fm);
> $query->setFields(array("SUM(flight_time_duration)"));
> list($sql, $bind) = $this->_flightMapper->storage()->process($query);
> $results = $this->_flightMapper->storage()->queryOne($sql, $bind);
> </code>
>
>
> I now have to do something like:
>
> <code>
> $query = Horde_RDO_Query::create(array('owner_id' => Auth::getAuth()), $fm);
> $query->setFields(array("SUM(flight_time_duration)"));
> $cursor = $this->_flightMapper->storage()->getCursor($query);
> $sum = $cursor->next();
> $return = $sum[0];
> </code>
>
> ....or am I being a complete idiot and missing something else?

I think the easiest way would be to create your own DML object and use  
it. The DML objects don't currently require a db connection of any  
sort - they're supposed to be usable from any connection backend - so  
you can create another one and use it however you need.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list