[dev] Recent RDO changes

Michael Rubinsky mike at theupstairsroom.com
Sat Nov 11 08:15:34 PST 2006


...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?

Thanks again.




Quoting Michael Rubinsky <mike at theupstairsroom.com>:

> Alright, this is what I get for writing against HEAD code.  The  
> recent  commits regarding the new DML objects totally broke a bunch  
> of my  scripts.  While investigating the changes to the class  
> interfaces, it  seems like something like:
>
> <code>
> $results = $this->_flightMapper->storage()->getCursor($query);
> </code>
>
> would be the 'new' way of doing:
>
> <code>
>  list($sql, $bind) = $this->_flightMapper->storage()->process($query);
>  $results = $this->_flightMapper->storage()->query($sql, $bind);
> </code>
>
> from outside any of the RDO objects.  (Code in above example is from  
> a  storage driver for an app I'm working on, and obviously   
> $this->_flightMapper refers to a  private class instance of a mapper  
>  object which is set in the class' constructor).
>
> Running the above code causes my server to die with a segfault, no   
> other messages or log entries.
>
> Before I investigate further, I just want to make sure my  
> assumptions  about how to do the above is correct...
>
>
> -- 
> Thanks,
> Mike
>
> "Am I getting old, or has the supermarket been playing great music lately?"



Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20061111/bb9148aa/attachment.bin


More information about the dev mailing list