Saturday, May 1, 2010

Re: Recursive = 2 but not all the way

And the correct answer is: i didn't read the manual carefully enough :))

Thanks mate!


On Sat, May 1, 2010 at 2:08 PM, Jeremy Burns <jeremyburns@me.com> wrote:
My favourite answer:http://book.cakephp.org/view/1323/Containable all the way baby.

Jeremy Burns
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 1 May 2010, at 11:53, Andrei Mita wrote:

Maybe I didn't read the book carefully enough but, is there a way to set recursive to get all related data bur from a pool of models?

For instance
Groups hasMany Users
Users hasOne Group
Users hasOne Profiles
Profiles belongsTo Users

Users hasMany Articles
Articles belongsTo Users

Users hasMany News
News belongsTo Users

Recursive = 0 : pagination on Articles will get me all the articles and related user information
Recursive = 1: the same
Recursive = 2: pagination on Articles will get me all the data related with users, profiles, groups, news....basically everything

How can I get only Users, Profiles and Articles information with a pagination on Articles?
 


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

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

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

Re: Recursive = 2 but not all the way

My favourite answer:http://book.cakephp.org/view/1323/Containable all the way baby.

Jeremy Burns
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 1 May 2010, at 11:53, Andrei Mita wrote:

Maybe I didn't read the book carefully enough but, is there a way to set recursive to get all related data bur from a pool of models?

For instance
Groups hasMany Users
Users hasOne Group
Users hasOne Profiles
Profiles belongsTo Users

Users hasMany Articles
Articles belongsTo Users

Users hasMany News
News belongsTo Users

Recursive = 0 : pagination on Articles will get me all the articles and related user information
Recursive = 1: the same
Recursive = 2: pagination on Articles will get me all the data related with users, profiles, groups, news....basically everything

How can I get only Users, Profiles and Articles information with a pagination on Articles?
 


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

Recursive = 2 but not all the way

Maybe I didn't read the book carefully enough but, is there a way to set recursive to get all related data bur from a pool of models?

For instance
Groups hasMany Users
Users hasOne Group
Users hasOne Profiles
Profiles belongsTo Users

Users hasMany Articles
Articles belongsTo Users

Users hasMany News
News belongsTo Users

Recursive = 0 : pagination on Articles will get me all the articles and related user information
Recursive = 1: the same
Recursive = 2: pagination on Articles will get me all the data related with users, profiles, groups, news....basically everything

How can I get only Users, Profiles and Articles information with a pagination on Articles?
 

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

Re: Bakery...arrogance or plain lack of attention

On Apr 29, 11:22 pm, jacmoe <jac...@mail.dk> wrote:
> I was maybe a bit too harsh, but Mr. Wadhwani failed to notice that we
> are indeed trying to fix the issues, and that this is not borne out of
> arrogance.
> I understand that he's pissed off, of course.
> And that he's letting out some steam.

while the bakery - and the review process - is far from perfect it's
worth noting the following (for the unknowing bystanders):

The article was titled "Simple Jquery Treeview Helper"
It didn't do anything that existing code doesn't already let you do
[1]
Jayesh did discuss his article with a core member in the irc channel
weeks before this post [2]

While the article shouldn't have been deleted without a comment to the
author (I don't remember, is the deletion of stale articles
automatic?) it wasn't destined to be published and Jayesh didn't do
anything about the articles shortcoming (which would be difficult
since the main problem was surely the tiny nature of the code and that
it repeats core - and other - existing functionality)

hth

AD
[1] http://api.cakephp.org/class/html-helper#method-HtmlHelpernestedList
(amongst other code solutions)
[2] http://irc.cakephp.org/search/cakephp/Wadhwani_J

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

Sort of OT about Models

Trying to design a db with multiple relationships between tables, I'm not sure if it's better to use identifying or non-identifying relationships from cake point of view.

My guess is to go with non-identifying, but not sure at all.

Any advice? Thanks.

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

Re: Selected option in select

OMG it's unbelievable. It works and I dind't do anything to it. If I hit F5, the selection disappears but if I click on the edit link, everything is OK. Good enough for me. Maybe it's the browser.

So, here are my to working solutions:

        $options=array(
            'Generatia 1'=>'Generatia 1',
            'Generatia 2'=>'Generatia 2',
            'Generatia 3'=>'Generatia 3',
            'Mesteri' => 'Mesteri'
        );
       
        //Using select, no lable
        echo $form->select('group', $options, array('selected' => $this->data['Profile']['group']));
       
        //Using input, with label
        echo $form->input('group', array(
                                        'options' => $options,
                                        'selected' => $this->data['Profile']['group'],
                                        'label' => 'Grup')
                          );


Thanks


On Sat, May 1, 2010 at 10:05 AM, WebbedIT <paul@webbedit.co.uk> wrote:
Why are we not using (and I have tested this using 1.2.6)?

$form->input('Profile.group', array('options'=>$groups));

Where $groups is the options array relating to the Profile.group
field, the fact you supply an options array tells the form helper to
automatically create a select list.

If $this->data['Profile']['group'] is set in the controller (either
manually or from a Model->find call) the form helper will
automatically select it if the value matches a key in your $groups
array.

HTH

Paul

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

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

Re: Selected option in select

Why are we not using (and I have tested this using 1.2.6)?

$form->input('Profile.group', array('options'=>$groups));

Where $groups is the options array relating to the Profile.group
field, the fact you supply an options array tells the form helper to
automatically create a select list.

If $this->data['Profile']['group'] is set in the controller (either
manually or from a Model->find call) the form helper will
automatically select it if the value matches a key in your $groups
array.

HTH

Paul

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