cake-php
[Arriba] [Todas las Listas]

Re: Estructura del dato regresado por $esto->Modelo->encontrar

To: cake-php@xxxxxxxxxxxxxxxx
Subject: Re: Estructura del dato regresado por $esto->Modelo->encontrar
From: Frank Weindel <foxtrotwhiskey9@xxxxxxxxx>
Date: Wed, 12 Jun 2013 12:57:52 -0700 (PDT)
Cc: feedback2003@xxxxxxxxxx
Delivery-date: Thu, 13 Jun 2013 01:22:36 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:date:from:to:cc:message-id:in-reply-to:references :subject:mime-version:x-original-sender:reply-to:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=c0genar1Yo/WHDN60Pp9ZnGRovDlXrnMkAQT1q9pckc=; b=r6Q/W5Vwo28pA87ikofT2IQO9Z9WpJ85TJ7YqNMSzbeXFhoEfkhyfEVApuPMdUzJZu rezQM1XEVlqu5W5bgqm3yRYXl6VNx7aZdLFkpaaZiCU+Sv+eAALd6rQsLwCl4cTQKrDR duqZ2fIyZOKJ7Jr6qWVFV2aRUaUH0+IUCxmP+5IjF8jhYikAc3xQXjHTS4xt/pKAA9sy 4RJYOpUZKjtOMBUR8S6KNjjvRIVbaxD4NMwI/pBtnG3qUFj/HrLZdrOSDaZIi3Pl+TPS Q4ofr/scxtSSFsiBUOHJ6Z/NKqnwNYuzvDsSA4ive6SqBM7lUVrIkhn5M47ZkwVmosUs xtGg==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-beenthere:date:from:to:cc:message-id:in-reply-to:references :subject:mime-version:x-original-sender:reply-to:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=c0genar1Yo/WHDN60Pp9ZnGRovDlXrnMkAQT1q9pckc=; b=iPd9XEuyB7AdskwbrSUyJ8holmkgG3Fz1caGh25a+p3/E8Xmjv1tqb1WhLcCc5i8Tr 7ZD/cAPYeU2giwqwTmqUH39WQI9/adrrcpyxL0018G1oTdn1ugkhtonZ4+6NvhLrUc8e FuJikdjzI9T34alvgYxneyVJDberwWTWLnkHbtalGnMyb5AKUWmGeANCIM07kKGgSYwI Ygei1bCRV/NAAc+X1bBA2DvURXSmQxk1YaHtQY73iSO86+ldNBZxtzf+L8dzm3B/RQZ5 19nfUBgX9EgJ23ja4yzHkpZUPAKx9bPbAKusr87WW6YXBCsz5zj3WOurcxxdpBhd/SiH BDfw==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <3a492fff-829c-4feb-a978-bf026e52fe6d@a34g2000yqn.googlegroups.com>
List-archive: <http://groups.google.com/group/cake-php?hl=en>
List-help: <http://groups.google.com/support/?hl=en>, <mailto:cake-php+help@googlegroups.com>
List-id: <cake-php.googlegroups.com>
List-post: <http://groups.google.com/group/cake-php/post?hl=en>, <mailto:cake-php@googlegroups.com>
List-subscribe: <http://groups.google.com/group/cake-php/subscribe?hl=en>, <mailto:cake-php+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/cake-php/subscribe?hl=en>, <mailto:googlegroups-manage+1003367825667+unsubscribe@googlegroups.com>
Mailing-list: list cake-php@xxxxxxxxxxxxxxxx; contact cake-php+owners@xxxxxxxxxxxxxxxx
References: <3a492fff-829c-4feb-a978-bf026e52fe6d@a34g2000yqn.googlegroups.com>
Reply-to: cake-php@xxxxxxxxxxxxxxxx
Sender: cake-php@xxxxxxxxxxxxxxxx
Tiene cualquiera mirado a este más lejano? Estoy encontrando esto muy frustrando. Justo hace sentido para tener asociaciones *nested, pero no entiendo para 
la vida de mí por qué esto no pasa para el elemento de modelo de la raíz.

Frank *Weindel

En martes, mayo 4, 2010 4:26:12 SOY *UTC-4, Roland *B escribió:
>
> *Hi, 
>
> es allí una manera de cambiar la estructura del dato regresado por un modelo 
> encuentra llamada? O tener que utilizo una llamada diferente? *IMHO, el *default parece 
> para ser *inconsistent en la manera maneja asociaciones: 
>
> Dado este modelo: 
> //--------------------------------------- 
> clase *Querycategory extiende *AppModel 
>    #unknown{^*var $*recursive = 10; 
>    *var $*hasMany = variedad( 
>           '*Querycategory' => variedad('orden' => 'ASC de nombre'), 
>           '*Querygroup'    => variedad('orden' => 'ASC de nombre')); 
> } 
> //--------------------------------------- 
>
> Una llamada a $esto->*Querycategory->encontrar('todo') cosechas algo así: 
>  
>
> Variedad 
> ( 
>     [0] => Variedad 
>         ( 
>             [*Querycategory] => Variedad 
>                 ( 
>                     [*id] => 70 
>                     [*querycategory_*id] => 34 
>                     [0] => Variedad 
>                         ( 
>                             [*id] => 71 
>                             [*querycategory_*id] => 70 
>                             [*Querygroup] => Variedad 
>                                 ( 
>                                     [0] => Variedad 
>                                         ( 
>                                             [*id] => 43 
>                                             [*querycategory_*id] => 71 
>                                         ) 
>                                 ) 
>                         ) 
>                 ) 
>             [*Querygroup] => Variedad 
>                 ( 
>                 ) 
>         ) 
> ) 
>
> Un *Querygroup pertenencia a la Raíz-*Querycategory es en el mismo nivel 
> como el nodo de raíz y él es llamado *Querygroup. 
> Un *Querygroup la pertenencia a una categoría de niño es dentro que nodo de niño 
> y él es llamado *Querygroup. 
> Un *Querycategory la pertenencia a cualquier otra categoría es dentro de su padre 
> y *unnamed, a no ser que hay también un *Querygroup en el mismo nivel: entonces 
> es llamado '*Querycategory' 
>
> preferiría: 
> *Querygroup es siempre contenido en es "padre", siempre siendo llamado 
> '*Querygroup'. 
> *Querycategory Es siempre contenido en su "padre", siempre siendo llamado 
> '*Querycategory'. 
>
> Es allí "una manera estándar" de conseguir esto? 
>
> Utilizando pastel-1.2. 
>
>
> *Thank Tú mucho anticipadamente, 
>
> Roland 
>
> Comprueba el nuevo *CakePHP sitio de Cuestiones *http://*cakeqs.*org Y ayudar 
> otros con su *CakePHP cuestiones relacionadas. 
>
> Recibiste este mensaje porque eres *subscribed al *Google Grupos 
> "*CakePHP" grupo. 
> A correo a este grupo, envía *email a cake...@xxxxxxxxxxxxxxxx<*javascript:> 
> A *unsubscribe de este grupo, envía *email a pastel-*php+u...@xxxxxxxxxxxxxxxx 
>  <*javascript:> Para más opciones, visita este 
> grupo en *http://grupos.*google.*com/Pastel/de grupo-*php?*hl=*en 
>

-- 
Gustarnos en *FaceBook *https://www.facebook.com/*CakePHP
nos Encuentra en *Twitter *http://*twitter.*com/*CakePHP

--- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*CakePHP" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a pastel-*php+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a pastel-php@xxxxxxxxxxxxxxxx.
Visita este grupo en *http://grupos.*google.*com/Pastel/de grupo-*php?*hl=*en.
Para más opciones, visita *https://grupos.*google.*com/Los Grupos/optan_fuera.


Has anyone looked into this further? I'm finding this very frustrating. It 
just makes sense to have associations nested, but I do not understand for 
the life of me why this doesn't happen for the root model item.

Frank Weindel

On Tuesday, May 4, 2010 4:26:12 AM UTC-4, Roland B wrote:
>
> Hi, 
>
> is there a way to change the structure of data returned by a model's 
> find call? Or should I use a different call? IMHO, the default seems 
> to be inconsistent in the way it handles associations: 
>
> Given this model: 
> //--------------------------------------- 
> class Querycategory extends AppModel 
> { 
>    var $recursive = 10; 
>    var $hasMany = array( 
>           'Querycategory' => array('order' => 'name ASC'), 
>           'Querygroup'    => array('order' => 'name ASC')); 
> } 
> //--------------------------------------- 
>
> A call to $this->Querycategory->find('all') yields something like 
> this: 
>
> Array 
> ( 
>     [0] => Array 
>         ( 
>             [Querycategory] => Array 
>                 ( 
>                     [id] => 70 
>                     [querycategory_id] => 34 
>                     [0] => Array 
>                         ( 
>                             [id] => 71 
>                             [querycategory_id] => 70 
>                             [Querygroup] => Array 
>                                 ( 
>                                     [0] => Array 
>                                         ( 
>                                             [id] => 43 
>                                             [querycategory_id] => 71 
>                                         ) 
>                                 ) 
>                         ) 
>                 ) 
>             [Querygroup] => Array 
>                 ( 
>                 ) 
>         ) 
> ) 
>
> A Querygroup belonging to the Root-Querycategory is at the same level 
> as the root node and it is called Querygroup. 
> A Querygroup belonging to a child category is inside that child node 
> and it is called Querygroup. 
> A Querycategory belonging to any other category is inside its parent 
> and unnamed, unless there is also a Querygroup at the same level: then 
> it is called 'Querycategory' 
>
> I would prefer: 
> Querygroup is always contained in it's "parent", always being called 
> 'Querygroup'. 
> Querycategory is always contained in its "parent", always being called 
> 'Querycategory'. 
>
> Is there a "standard way" to achieve this? 
>
> Using cake-1.2. 
>
>
> Thank you very much in advance, 
>
> Roland 
>
> 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 cake...@xxxxxxxxxxxxxxxx<javascript:> 
> To unsubscribe from this group, send email to 
> cake-php+u...@xxxxxxxxxxxxxxxx <javascript:> For more options, visit this 
> group at http://groups.google.com/group/cake-php?hl=en 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


<Anterior por Tema] Tema Actual [Siguiente por Tema>
  • Re: Estructura del dato regresado por $esto->Modelo->encontrar, Frank Weindel <=