Probably this is a known issue already, but I want to mention it just
in case.
I discovered this just now.
The doSelect method of the Peer classes will throw an exception if I
pass a non empty Criteria
which contains a subset of the table's fields.
This happens because the hydrate method of the class, assumes that all
fields will be present in the
ResultSet.
This is a code snipset which demonstrates the issue:
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->wa_id = $rs->getInt($startcol + 0);
$this->wa_hydro_id = $rs->getInt($startcol + 1);
$this->wa_depth = $rs->getFloat($startcol + 2);
... and so on
I'd suggest to add this code in the Peer class in order to avoid the
illusion I had about the doSelect
method.
if (count($criteria.getSelectColouns()) != 0 ||
count($criteria.getSelectColouns()) != NUM_COLS) {
throw new SomeException("All or none of the columns should be
specified");
}
A better solution would be to check in the hydrate method if a field is
in the ResultSet and initialize the member of the class only if it
exists in the ResultSet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs
-~----------~----~----~----~------~----~------~--~---