Find question

2 messages Options
Embed this post
Permalink
celso-2

Find question

Reply Threaded More More options
Print post
Permalink

Hello Everybody!
I have this models:

http://picasaweb.google.com.br/celsowm/Screenshots#5399915797002091778

And i need retrieve this:

     Proprietario.nome , Veiculo.placa , sum (Infracoes.pontuacao) as
pontos

Proprietario "hasMany" Veiculo
Veiculo "habBelongsToMany" Infracoes


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

celso-2

Re: Find question

Reply Threaded More More options
Print post
Permalink

so crazy... but

    //var $hasMany = 'Veiculo';
    var $hasOne = array('PessoaFisica', 'PessoaJuridica','Veiculo');

get all left joins in one SELECT

On 3 nov, 14:09, Celso <[hidden email]> wrote:

> Hello Everybody!
> I have this models:
>
> http://picasaweb.google.com.br/celsowm/Screenshots#5399915797002091778
>
> And i need retrieve this:
>
>      Proprietario.nome , Veiculo.placa , sum (Infracoes.pontuacao) as
> pontos
>
> Proprietario "hasMany" Veiculo
> Veiculo "habBelongsToMany" Infracoes
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---