Hi there.

My model uses multiply tables, not single one. Those tables have
unique CHAR strings as primary key, so they don't intersect.

I need my model to search through all of these tables. But cake's FIND
method doesn't allow to specify table to search in. And also doesn't
allow to use mysql's UNITE constructions.
So, I should use such an monster construction like

__________________________________________
$this->setSource($table1);
$r=$this->find(....);
if (! $r)
{
$this->setSource($table2);
$r=$this->find(....);
}
if (! $r)
{
$this->setSource($table3);
$r=$this->find(....);
}
& etc
__________________________________________

It seems to me to be at least extreamly slow. All this job can be mady
with only one MySQL query like:

__________________________________________
SELECT <..> FROM `<table1>` WHERE <..> ORDER <..> <...>
UNITE
SELECT <..> FROM `<table2>` WHERE <..> ORDER <..> <...>
UNITE
SELECT <..> FROM `<table3>` WHERE <..> ORDER <..> <...>
& etc
__________________________________________

Do you have idea, how to do it? It seems to me, that the only way is
copypasting cake's "find" method and changing it my situation.
Maybee there is another way?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en

Reply via email to