Find question

View: New views
2 Messages — Rating Filter:   Alert me  

Find question

by celsowm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Find question

by celsowm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 <cels...@...> 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 cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---