Hello guys,

So I asked a question about having clauses using $this->Model->find()
method, and the answer was daunting, in my opinion: use in Model Class
$this->query() method within a custom method... OK. I shall do it this
way.

One of the problems I face using $this->query() is:

Whenever I have a special field, the result parser puts it in a
different key.

For instance:

$qry = $this->query("SELECT `Table`.*, `Table`.field * 1000 as
specialfield FROM ....");

it would return $qry as
Array( 0 =>
Array("Table" => Array("field" => "1", "field2" => "value"), 0 =>
Array("specialfield" => "1000"), ...
);

What do I do?

I array_walk the result, array_mergin Table with 0... eventually it
turns into:
Array( 0 =>
Array("Table" => Array("field" => "1", "field2" => "value",
"specialfield" => "1000"), ...
);

Is there any more practical way doing it?

thanks you guys!

[]s
Dérico Filho
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to