Re: How to do recursion more than 2 levels deep using the one table?

2013-05-26 Thread André Luis
> array( > 'id' => '4', > 'name' => '2nd_2', > (int) 0 => array( > 'id' => '5', > 'nam

Re: How to do recursion more than 2 levels deep using the one table?

2013-05-25 Thread DJ
b->Street with join tables the recursion works fine. On Saturday, May 25, 2013 5:52:30 AM UTC+10, André Luis wrote: > > I didnt really understand what you really want, but it seems that it´s a > work for TreeBehavior > > In TreeBehavior you have id, parent_id, lft and rg

Re: How to do recursion more than 2 levels deep using the one table?

2013-05-24 Thread André Luis
gt; '1', > 'b_resource_id' => '2' > ) > ), > (int) 1 => array( > 'id' => '4', > 'name'

How to do recursion more than 2 levels deep using the one table?

2013-05-24 Thread DJ
x27; => '3rd_2', 'ResourcesResource' => array( 'id' => '4', 'a_resource_id' => '4',

Re: Pagination with recursion while using loadModel

2011-03-20 Thread ShadowCross
In the CakePHP Book (http://book.cakephp.org/view/1039/Associations- Linking-Models-Together), there are several sections that you should note: In the end of "3.7.6.5 hasAndBelongsToMany (HABTM)" (although it applies to all relation types), the Book states: The same binding trick can be used to e

Re: Pagination with recursion while using loadModel

2011-03-19 Thread euromark
have you tried var $uses = array('Transaction'); PS: why is your model Transactions??? and not Transaction? On 19 Mrz., 07:26, "ashok.b" wrote: > Hi, In my "Reports" controller, which is just a dummy controller > without any actual database, I'm trying to generate a paginated view > of other mo

Pagination with recursion while using loadModel

2011-03-18 Thread ashok.b
Hi, In my "Reports" controller, which is just a dummy controller without any actual database, I'm trying to generate a paginated view of other models. For example, to generate paginated view of "Transactions" model I'm doing the following: $this->loadModel('Transactions'); $this->Transactions- >bi

Re: how to call a recursion in cakephp view

2011-02-08 Thread LipeDjow
Hi, Try changing the var name inside the iteration, you have 2 vars with same name ($categories). 0) { $child_categories=$this->requestAction('/categories/showlist',array($cat['Category']['id'])); echo $this->element('showlist-dynamic',array('categories' => $child_categories))

Re: how to call a recursion in cakephp view

2011-02-07 Thread Sam Sherlock
So you plan to call request action recursivley from within an element that calls itself to me that sounds like the wrong way to do it for many reasons google mptt data - S On 7 February 2011 13:38, indra wrote: > I have categories table with > id,name,pcategory_id > I have created control

how to call a recursion in cakephp view

2011-02-07 Thread indra
I have categories table with > id,name,pcategory_id I have created controller > categories_controller and created function there function showlist($id = 0) { $this->set('categories', $this->Category->find('all', array('conditions' => array('Category.pcategory_id='.$id; }

Re: Performance Tuning Issues : Recursion in Models

2010-04-02 Thread nurvzy
gt; found that actually deleting my app/tmp/cache/models entries helped improve > performance since there must have been some old stuff in there.   > > I think the models have too much recursion.  The entire application is user > centric and every model has some reference back to the use

Re: Problem with recursion and Containable

2010-02-25 Thread John Andersen
Please show the code (copy/paste) from your models, where you define the relationships/associations. I suggest from the Permit, Leader, Country and ProvState models. John On Feb 25, 8:04 pm, "Arak Tai'Roth" wrote: > For the second one, I get data from the Leader model as well as the > Country

Re: Problem with recursion and Containable

2010-02-25 Thread Arak Tai'Roth
For the second one, I get data from the Leader model as well as the Country and ProvState model contained in Leader, that is what is expected. In the first one, I expect the same, while also getting back RegistrationLocation, User, and Activity. For the second one, I get all the right data, except

Re: Problem with recursion and Containable

2010-02-25 Thread John Andersen
What result are you getting and what is the expected result? Do you get errors or nothing at all? Just to compare your two finds, could you remove User, RegistrationLocation and Activity from the second find and retry! Enjoy, John On Feb 25, 9:22 am, "Arak Tai'Roth" wrote: > So I've been searc

Problem with recursion and Containable

2010-02-24 Thread Arak Tai'Roth
So I've been searching for a solution to my problem for a little while now. However everything I find seems to imply that what I am doing is correct, so I am rather confused about this at the moment. Likely it's something simple, but I'm sure as heck not seeing it. I have a model named Leader, whi

Re: Containable with recursion?

2009-12-22 Thread Jamal Aziz
You can use function find in your model using parameter 'threaded'. For example if you want to get all children of United States (with id = 1): $locations = Location->find('threaded', array('condition' => array ('id' => $id))); For further reference, look at http://book.cakephp.org/view/73/Retri

Containable with recursion?

2009-12-22 Thread Michael Gaiser
So I have a model setup where a location can link to itself as a parent. (states and cities are all locations, San Francisco would have the California set to its parent_id). Now my issue is that I am trying to build a function that when given a location id, it will return an array of all the childr

could nested elements cause recursion in the ajax component?

2009-10-29 Thread paulinthought
27;UserProfile'); $userlist = $this->UserProfile->getlist($this->Session- >read ('productid')); $this->loadModel('Image'); $users = $this->Image->getList($userlist); $this->set('use

ajax recursion in nested elements

2009-10-28 Thread paulinthought
rProfile'); $userlist = $this->UserProfile->getlist($this->Session->read ('productid')); $this->loadModel('Image'); $users = $this->Image->getList($userlist); $this->set('users', $

Re: cakephp recursion

2009-10-09 Thread LunarDraco
                        ) >                         ); > > it gets all the required info the same as using recursive=1 but doesnt > get the User data associated with the comments. > > any ideas > Thanks. > > On Oct 9, 1:24 am, broxi wrote: > > > Thanks for the

Re: cakephp recursion

2009-10-08 Thread Miles J
                            ) >                         ); > > it gets all the required info the same as using recursive=1 but doesnt > get the User data associated with the comments. > > any ideas > Thanks. > > On Oct 9, 1:24 am, broxi wrote: > > > Than

Re: cakephp recursion

2009-10-08 Thread broxi
ny ideas Thanks. On Oct 9, 1:24 am, broxi wrote: > Thanks for the reply, I will look into that > > Later > Broxi > > On Oct 8, 7:54 pm, Miles J wrote: > > > Ditch the recursion and use the Containable behavior. > > >http://book.cakephp.org/view/474/Containable

Re: cakephp recursion

2009-10-08 Thread broxi
Thanks for the reply, I will look into that Later Broxi On Oct 8, 7:54 pm, Miles J wrote: > Ditch the recursion and use the Containable behavior. > > http://book.cakephp.org/view/474/Containable > > On Oct 8, 9:52 am, broxi wrote: > > > Hi all, > > > I a

Re: cakephp recursion

2009-10-08 Thread Miles J
Ditch the recursion and use the Containable behavior. http://book.cakephp.org/view/474/Containable On Oct 8, 9:52 am, broxi wrote: > Hi all, > > I am a toatl noob with cakephp, i am trying to build a blog and i feel > that i am progresing quite well. I just have one question... >

cakephp recursion

2009-10-08 Thread broxi
Hi all, I am a toatl noob with cakephp, i am trying to build a blog and i feel that i am progresing quite well. I just have one question... I currently have 4 models (post, user, comment, catgeory), when reading a post from the database with recursive=0 i only get the post,user and category data

backward recursion possible?

2009-07-05 Thread SirHenry
When setting the recursive variable cakephp seems to fetch associated model data only in one direction. But I need it to go back at a certain point. Let's say we have 2 associated models: Bus hasAndBelongsToMany Person. If I do use §this->Bus->find() in the Bus Controller I get the associated Pe

Pull data from several models / depths of recursion into a single controller and view

2009-06-03 Thread bcm...@gmail.com
hink it can be. But this allows me to display the information stored in the listings table (name, address, etc.), one of the 'ListingImages' stored for the listing, all of the reviews for that listing, and the names of the users that wrote those reviews. This brings me to my question

Re: undetermined recursion

2009-03-03 Thread mscdex
This probably isn't exactly the answer you were looking for but, maybe you could use the Tree behavior instead? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cak

undetermined recursion

2009-03-03 Thread el_sime
plies. Examples Post A has 2 comments B and C. B has two replies D and F. F has one reply G. with $recursive = 2 i'd get all replies up to G, but if G gets replies i should increment the recursion level in order to get them. Same problem implementing Conteinable behaviour ('contain'

Re: ACL throwing self-joined model into infinite recursion

2009-02-17 Thread benjam
Seems to work great. I removed the 'Parent', and 'Child' relationship from Page, and refactored it to use the Tree behavior methods instead. Thanks. On Feb 16, 5:06 pm, benjam wrote: > I had thought of that (the Parent Child thing on multiple models) but > was hoping that Cake was smart enough

Re: ACL throwing self-joined model into infinite recursion

2009-02-16 Thread benjam
I had thought of that (the Parent Child thing on multiple models) but was hoping that Cake was smart enough to know which was which. Thanks for the info, I'll fiddle with it and post the outcome here... On Feb 16, 12:43 pm, AD7six wrote: > On Feb 16, 9:21 am, benjam wrote: > > > Here are some

Re: ACL throwing self-joined model into infinite recursion

2009-02-16 Thread AD7six
On Feb 16, 9:21 am, benjam wrote: > Here are some (hopefully) relevant code snippits:http://pastebin.com/f7426e0c4 > > On Feb 16, 8:55 am, benjam wrote: > > > I have just com across a very strange issue with Cake.  I have ACL > > installed in my app, and I havre a self-referencing table in tha

Re: ACL throwing self-joined model into infinite recursion

2009-02-16 Thread benjam
groups > model and controller. > > The trouble is, when I access a page that is directly related to ACL, > for some reason, the pages model (the self-referencing model), gets > thrown into an infinite recursion, trying to build the model > relationships, and gets stuck trying to go up

ACL throwing self-joined model into infinite recursion

2009-02-15 Thread benjam
model), gets thrown into an infinite recursion, trying to build the model relationships, and gets stuck trying to go up the tree. Here is an excerpt from my xdebug output when I get the "Fatal error: Maximum function nesting level of '100' reached" error: AppController->before

Re: Find with two levels of recursion in where clause

2009-02-07 Thread WebbedIT
Sorry to come back to this so late but thought I'd make a note on your solution. There should be no need to call $modelB = ClassRegistry::init('B'); as modelA should be related to modelB allowing you to use $this->modelA->modelB->unbindModel(array('belongsTo' => array('C))); $this->modelA->bindM

Re: Find with two levels of recursion in where clause

2009-01-29 Thread maxmil
Thanks a million that was exactly what i needed. Heres an example of the code that does what you instructed that may help someone else in the future, if it can be improved please let me know. The code executes from within the A model class (A.php) $modelB = ClassRegistry::init('B'); $modelB->un

Re: Find with two levels of recursion in where clause

2009-01-29 Thread maxmil
Thanks a million that was exactly what i needed. Heres an example of the code that does what you instructed that may help someone else in the future, if it can be improved please let me know. The code executes from within the A model class (A.php) $modelB = ClassRegistry::init('B'); $modelB->un

Re: Find with two levels of recursion in where clause

2009-01-28 Thread WebbedIT
You need to force a join from A to C using B so that you can specify conditions on C fields within your find ... sounds easy when I write it like that, and in fact it is quite easy once you get your head around it. You need to unbind the relationship between B and C then bind A to C setting 'fore

Re: Find with two levels of recursion in where clause

2009-01-28 Thread WebbedIT
> You can use Containable for what you're trying to do, I think. Containable does extra queries to find the extra data rather than joining all the tables and running one query hence you cannot use conditions on 2nd level associations. --~--~-~--~~~---~--~~ You rece

Re: Find with two levels of recursion in where clause

2009-01-28 Thread brian
You can use Containable for what you're trying to do, I think. On Wed, Jan 28, 2009 at 6:44 AM, maxmil wrote: > > I have the following scenario in my model. > > A has a ManyToOne relationship with B > B has a ManyToOne relationship with C > > I would like to use "find" on A but be able to put co

Find with two levels of recursion in where clause

2009-01-28 Thread maxmil
I have the following scenario in my model. A has a ManyToOne relationship with B B has a ManyToOne relationship with C I would like to use "find" on A but be able to put conditions on field in object C. Something like: $this->A->find('all', array('conditions' => array('B.C.someField' => 'someV

Re: Undesired Recursion in Models

2008-11-06 Thread Renesistemic
Adam, Thanks for the reply. I've read up on containable and had actually already begun implementing that behavior in certain locations throughout the application. While I can definitely see the performance gains in properly applying that behavior before calling Find(), I'm still a little weary ab

Re: Undesired Recursion in Models

2008-11-06 Thread Adam Royle
> In the hotels_controller.php or in the town_controller.php or both? > > 3rd. > Does contain work only with find or also with findBy? > > Thank you for all enlightening comments! > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [

AW: Undesired Recursion in Models

2008-11-06 Thread Liebermann, Anja Carolin
CTED] Im Auftrag von Adam Royle Gesendet: Donnerstag, 6. November 2008 07:46 An: CakePHP Betreff: Re: Undesired Recursion in Models Well the recursion is just symbolic. Cake will only create one instance for each of your models and uses references to that one model throughout your app. You can test

Re: Undesired Recursion in Models

2008-11-05 Thread Adam Royle
Well the recursion is just symbolic. Cake will only create one instance for each of your models and uses references to that one model throughout your app. You can test this out in your controller. var $uses = array('Site', 'Post'); function test(){ if ($this->Sit

Undesired Recursion in Models

2008-11-05 Thread Renesistemic
Hi. I've scoured the web to my best extent without wasting away days of time on this, and I'm stuck... I'm running a CakePHP site with RC3, and am having some serious memory overhead issues. As I came into this project picking up the pieces of another programmer, I've recently decided it'd be best

Re: Recursion

2008-10-22 Thread mirfan
Hello david All the problems ahve been solved now i am sending you an email where i have attached an image please give me some suggestion about that. Regards, On Oct 22, 9:22 pm, Luiz Poleto <[EMAIL PROTECTED]> wrote: > Well... > I've just find out what the error was... > > In my model, i had > >

Re: Recursion

2008-10-22 Thread Luiz Poleto
as trying it in a separate project it works as i > > > need but when i integrate it in my project it gives me an sql error i > > > don't know why is that problem coming please help me > > > > On Oct 20, 7:31 am, "David C. Zentgraf" <[EMAIL PROTECTED

Re: Recursion

2008-10-22 Thread Luiz Poleto
i integrate it in my project it gives me an sql error i > > don't know why is that problem coming please help me > > > On Oct 20, 7:31 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > >>http://book.cakephp.org/view/91/Tree > > >> On 19 Oc

Re: Recursion

2008-10-22 Thread David C. Zentgraf
ROTECTED]> wrote: >> http://book.cakephp.org/view/91/Tree >> >> On 19 Oct 2008, at 20:10,mirfanwrote: >> >> >> >>> Hi, >>> I have a problem with recursion. I have a table for keeping the >>> account information of all members in which ea

Re: Recursion

2008-10-21 Thread mirfan
31 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > http://book.cakephp.org/view/91/Tree > > On 19 Oct 2008, at 20:10,mirfanwrote: > > > > > Hi, > > I have a problem with recursion. I have a table for keeping the > > account information of all me

Re: Recursion

2008-10-19 Thread David C. Zentgraf
http://book.cakephp.org/view/91/Tree On 19 Oct 2008, at 20:10, mirfan wrote: > > Hi, > I have a problem with recursion. I have a table for keeping the > account information of all members in which each member has a parent > now i have to find out all of the members in th

Recursion

2008-10-19 Thread mirfan
Hi, I have a problem with recursion. I have a table for keeping the account information of all members in which each member has a parent now i have to find out all of the members in the downline of a specific one look at the following example. Member1

Re: Infinite Recursion

2008-07-04 Thread Jonathan Snook
> I had built a seemingly stable CakePHP app when one day, out of > nowhere, it began to display no errors and get itself stuck in an > infinite recursion loop anytime I add a component/model/helper -- ANY > class that doesn't exist. While I would agree that that the infinite

Infinite Recursion

2008-07-04 Thread jparonson
I had built a seemingly stable CakePHP app when one day, out of nowhere, it began to display no errors and get itself stuck in an infinite recursion loop anytime I add a component/model/helper -- ANY class that doesn't exist. I wrote over the cake directories and the same problem is occu

Re: partial recursion?

2008-06-21 Thread Turnquist, Jonah
> quarries, I saw a problem: > >>> 1)   DESCRIBE `scripts` > >>> 2)   DESCRIBE `categories`  //not needed! > >>> 3)   DESCRIBE `users` > >>> 4)   SELECT `Script`.`id`, `Script`.`title`, `Script`.`created`, > >>> `Script`.`

Re: partial recursion?

2008-06-21 Thread Ian Zepp
gt; 2) DESCRIBE `categories` //not needed! >>> 3) DESCRIBE `users` >>> 4) SELECT `Script`.`id`, `Script`.`title`, `Script`.`created`, >>> `Script`.`description`, `User`.`name`, `User`.`id` FROM `scripts` AS >>> `Script` LEFT JOIN `categories` AS `Category`

Re: partial recursion?

2008-06-20 Thread Turnquist, Jonah
AS > > `Script` LEFT JOIN `categories` AS `Category` ON > > (`Script`.`category_id` = `Category`.`id`) LEFT JOIN `users` AS `User` > > ON (`Script`.`user_id` = `User`.`id`) WHERE 1 = 1  //excessive! > > > You see, it is doing a left join on categori

Re: partial recursion?

2008-06-20 Thread Turnquist, Jonah
tegory_id` = `Category`.`id`) LEFT JOIN `users` AS `User` > ON (`Script`.`user_id` = `User`.`id`) WHERE 1 = 1  //excessive! > > You see, it is doing a left join on categories in quarry #4, and > quarry #2 is not even needed.  I understand joins can be slow.  Thus I > am asking how can I g

partial recursion?

2008-06-20 Thread Turnquist, Jonah
AS `User` ON (`Script`.`user_id` = `User`.`id`) WHERE 1 = 1 //excessive! You see, it is doing a left join on categories in quarry #4, and quarry #2 is not even needed. I understand joins can be slow. Thus I am asking how can I get rid of it I tried setting the option 'recursive' => -1

Cross Database HABTM model recursion

2008-06-20 Thread n00bi5h
I have searched to no avail so my apologies if this is covered elsewhere. I have a HABTM relationship across databases. It appears the only way to achieve this is using a model for the joining table. So instead of Project <-> Contact, it's Project -> ContactsProject <- Contact, like the following:

Re: Model recursion

2008-05-08 Thread MonkeyGirl
Thanks, Keymaster! It was one of those cases of not knowing what to look up in the first place. Now you've pointed me in the right direction, I'm trying just unbindModel to begin with, and if that's not a feasible solution, I'll use Bindable. Thanks again, Zoe. --~--~-~--~~---

Re: Model recursion

2008-05-08 Thread keymaster
http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings --~--~-~--~~~---~--~~ 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 T

Model recursion

2008-05-08 Thread MonkeyGirl
Hi. Sorry if this is obvious, but is it possible to set recursion to only go down (to things that belong to the model in question), and not up (to things that the model belongs to)? I've got a model that I've been recursing four levels deep, which has been working fine. Now, though, I&

Re: problem with related models and recursion

2008-04-23 Thread senser
any suggestions ??? On Apr 22, 2:05 pm, senser <[EMAIL PROTECTED]> wrote: > I don't think problem is withmodels, because if I comment the > variable "$hasMany=UnitI18n" in Unit model (i.e. Unit and UnitI18n are > NOTrelated) and Cake doesn't run queries on unit_18ns table but only > on unts. > >

Re: problem with related models and recursion

2008-04-22 Thread senser
I don't think problem is with models, because if I comment the variable "$hasMany=UnitI18n" in Unit model (i.e. Unit and UnitI18n are NOT related) and Cake doesn't run queries on unit_18ns table but only on unts. Adding the variable "$hasMany" in Unit model causes Cake to run query on unit_i18ns

Re: problem with related models and recursion

2008-04-21 Thread senser
### file models/category_i18ns.php ### class CategoryI18n extends AppModel{ var $name='CategoryI18n'; var $recursive=2; var $validate=array('category_id'=>array('required'=>VALID_NOT_EMPTY, '

Re: problem with related models and recursion

2008-04-20 Thread Federico Rinaldi
Can you provide also the CategoryI18n and the UnitI18n models? 2008/4/21 senser <[EMAIL PROTECTED]>: > > any ideas ??? > > On Apr 19, 10:33 am, senser <[EMAIL PROTECTED]> wrote: > > Hello! > > > > I have fivemodels: Offers, Category, CategoryI18n, Unit & UnitI18n > > and they're associated as fo

Re: problem with related models and recursion

2008-04-20 Thread senser
any ideas ??? On Apr 19, 10:33 am, senser <[EMAIL PROTECTED]> wrote: > Hello! > > I have fivemodels: Offers, Category, CategoryI18n, Unit & UnitI18n > and they're associated as follows: > > Offer--belongsTo-->Category > Offer--belongsTo-->Unit > Category--hasMany-->CategoryI18n > Unit--hasMany--

problem with related models and recursion

2008-04-19 Thread senser
Hello! I have five models: Offers, Category, CategoryI18n, Unit & UnitI18n and they're associated as follows: Offer--belongsTo-->Category Offer--belongsTo-->Unit Category--hasMany-->CategoryI18n Unit--hasMany-->UnitI18n and here is the code from models: ### file models/offer.php ### class Offe

problem with related models and recursion

2008-04-19 Thread senser
Hello! I have five models: Offers, Category, CategoryI18n, Unit & UnitI18n and they're associated as follows: Offer--belongsTo-->Category Offer--belongsTo-->Unit Category--hasMany-->CategoryI18n Unit--hasMany-->UnitI18n and here is the code from models: ### file models/offer.php ### class Offe

Re: Conditions and recursion

2007-12-10 Thread Baz
er_id] => 1 > > [item_id] => 2 > > > > ) > > ) > > ) > > > > However if take out the conditions in the User Model I get: > > Array > > ( > > [User] => Array > > ( > > [i

Re: Conditions and recursion

2007-12-10 Thread [EMAIL PROTECTED]
> [User] => Array > ( > [id] => 1 > [email] => email > ) > [Cart] => Array > ( > [0] => Array > ( > [id] => 2 > [title] => Starbucks

Conditions and recursion

2007-12-10 Thread [EMAIL PROTECTED]
tle] => Starbucks Assortment [carts] => Array ( [user_id] => 1 [item_id] => 2 ) [Sale] => Array (

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-26 Thread designvoid
Sorted! It was that plural, dropped the 's' and BINGO! d. On Nov 24, 7:15 pm, designvoid <[EMAIL PROTECTED]> wrote: > The uses array is only there to test the Variations call, I would > remove it in finished thing. > > The plurals are the names of the arrays I thought, and as such didn't > matte

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-24 Thread designvoid
The uses array is only there to test the Variations call, I would remove it in finished thing. The plurals are the names of the arrays I thought, and as such didn't matter what I called them..? Also, I dont like the convention of naming id fields 'just' id, I'm cool with the config options tho,

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-24 Thread DJ Spark
also, you don't need, usually, to use more than one model per controller ( uses('Model1', 'Model2') ), if they are associated somehow: this $this->Variations->findAll() could be $this->Product->Variation->findAll() I didn't run any tests, but I can see some points: class VariationOption ex

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread designvoid
I have full debug on and all the queries seem to be correct. If I change: $this->set('products', $this->Product->findAll()); to $this->set('products', $this->Variations->findAll()); it it comes back with the variations and associated options fine! So it seems the join between 'groups' the 2 i

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread bingo
hi designvoid I am 100% confident it has something to do with how setup HABTM (belongsTo, etc) relationships. CakePHP is pretty good in dealing with recursive queries. One way to figure out what's happing is to use debug mode = 2 . That will print out all the SQL queries and will allow to see wh

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread designvoid
Hi Bingo, Cheers for the heads up on that - I'll definately give it a shot! I'm still wondering tho, is it my code that is the problem or a limitation of Cake? I'd like to fully understand why this issue is occuring before moving on to other scripts etc... d. On Nov 23, 8:00 pm, bingo <[EMAIL

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread bingo
hi designvoid, I would suggest you that you get that script. In my experience of using CakePHP, I found it very useful. But I started using that script before CakePHP 1.2 came into existence and continuing to still use it in 1.2. You might also want to see if 1.2 has any such functionality. Reg

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread designvoid
I'm not using that script, I'm relatively new to Cake, making good progress but this has stumped me... Is that script needed to do what I want? Or is there a way in vanilla Cake? t. On Nov 23, 6:19 pm, bingo <[EMAIL PROTECTED]> wrote: > I guess you need to set (assuming you are using unbindMod

Re: Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread bingo
I guess you need to set (assuming you are using unbindModel script http://bakery.cakephp.org/articles/view/an-improvement-to-unbindmodel-on-model-side) $this->Product->Variations->expects('Options); $this->Product->expects('Variations); $this->set('products', $this->Product->findAll()); bingo

Strange recursion problem (i think) - hopefully someone can shed some light (code inc.)

2007-11-23 Thread designvoid
Hi all, I'm having a wierd issue when trying to use 3 models together via 1 findAll()... I'll paste the code then, explain what's happening, fingers crossed one I you fine folk will be able to give a me a pointer as to what I'm missing... Basic overview: Products has multiple Variations and Var

Re: Recursion for my own custom query?

2007-06-19 Thread AD7six
On Jun 18, 3:03 pm, Joshua Benner <[EMAIL PROTECTED]> wrote: > Looks good. I think I would use Cake's magic before writing my own function > like that, Cake doesn't change the rules as far as DBs go. If creating an extra table & model to avoid writing a GROUP BY statement with some date funct

Re: Recursion for my own custom query?

2007-06-18 Thread Joshua Benner
Looks good. I think I would use Cake's magic before writing my own function like that, though. However, the function also accomplishes more than the initial target functionality. AD7six wrote: On Jun 18, 1:55 pm, Joshua Benner <[EMAIL PROTECTED]> wrote: Consider using a 'Months

Re: Recursion for my own custom query?

2007-06-18 Thread AD7six
On Jun 18, 1:55 pm, Joshua Benner <[EMAIL PROTECTED]> wrote: > Consider using a 'Months' table for which you define a 'Month' model which > has associations defined between it and 'Entry' > Then: > $this->Month->findAll(array('monthName'=>'January')) Or not :). http://bin.cakephp.org/saved/20

Re: Recursion for my own custom query?

2007-06-18 Thread Joshua Benner
Consider using a 'Months' table for which you define a 'Month' model which has associations defined between it and 'Entry' Then: $this->Month->findAll(array('monthName'=>'January')) Pete wrote: I have a function in my model, to get a list of the months that I have blog entries in: functi

Recursion for my own custom query?

2007-06-17 Thread Pete
I have a function in my model, to get a list of the months that I have blog entries in: function getMonths($limit = null) { $sql = "SELECT DISTINCT month(Entry.date) number, monthname(Entry.date) title, year(Entry.date) year FROM entries as Entry ORDER BY date DESC"; if ($limit): $sql .= " LIMIT

Re: bindModel not works if recursion is too low?

2007-01-21 Thread Claudio Poli
m->ForumLastPost->User->useModel(array('User')); $this->Forum->ForumTopics->useModel(array('TopicLastPost', 'TopicAuthor')); $this->Forum->ForumTopics->TopicLastPost->useModel(array('User')); thanks again. On 21/gen/07, at 15:00,

Re: bindModel not works if recursion is too low?

2007-01-21 Thread Claudio Poli
thanks for the kind response :) On 21/gen/07, at 15:00, Grant Cox wrote: > > Yes, the bound "TopicLastPostAuthor" is 3 levels of recursion from > your > Forum model, ie: > $this->Forum->ForumTopics->TopicLastPost->TopicLastPostAuthor > > So, you n

Re: bindModel not works if recursion is too low?

2007-01-21 Thread Grant Cox
Yes, the bound "TopicLastPostAuthor" is 3 levels of recursion from your Forum model, ie: $this->Forum->ForumTopics->TopicLastPost->TopicLastPostAuthor So, you need to use a recursive of at least 3 to get that data automatically loaded. To simplify your bind/unbind, I w

bindModel not works if recursion is too low?

2007-01-21 Thread Claudio Poli 
hi there, I've a question about bindModel, the details and core are here: http://bin.cakephp.org/view/414114170 basically I've set up a recursion of 2, and I need to bind a model on the fly, but this is not working and I suspect that it has to do with recursion level. thanks for

Re: Self recursion problem

2006-11-19 Thread [EMAIL PROTECTED]
able: > menu > (id pri_key int(5), > name varchar(200), > parent_id int(5)) > > Data looks like this: > > 1,Home,0 > 2,Pages,0 > 3,First Page,2 > 4,Second Page,2 > 5,Contacts,0 > > I would like to get recursion results, like this > > Ho

Self recursion problem

2006-11-19 Thread voriux
Hi people, I would like to ask a noob question how to model this situation? I have table: menu (id pri_key int(5), name varchar(200), parent_id int(5)) Data looks like this: 1,Home,0 2,Pages,0 3,First Page,2 4,Second Page,2 5,Contacts,0 I would like to get recursion results, like this Home

Re: Problems with OthAuth - unintended recursion in model?

2006-07-17 Thread CraZyLeGs
set recursion in your models accordingly I've fixed that in a new version I'm working on to allow only Models needed in the auth process to be included in the session.. Actually the only issue is that Cake doesn't offcially have a unbindAll method to unbind all associations from

Re: Problems with OthAuth - unintended recursion in model?

2006-07-16 Thread AD7six
M wrote: > But back to the point - to check on othAuth's storage of login info, I This may well be a question for the author then. > Still, this brings me back to my original issue - when I go to a page > that requires a login, i get redirected to login page, but when I > login, I do not get s

Re: Problems with OthAuth - unintended recursion in model?

2006-07-16 Thread M
Actually, I was not looking at that, I assumed somewhere there was something that was breaking recursion since I do get a page returned. Debug output is not exactly most readable as it is not seem to be of much use unless you know exactly what you are looking for. :-/ (Which I guess is the point

Re: Problems with OthAuth - unintended recursion in model?

2006-07-16 Thread AD7six
Hi M, I don't use OthAuth, but if you are referring to the text "* Recursion *" that appears in the model debug output, this isn't something to worry about. If Model a is defined to linked to model b, and model bi is defined to be linked to model a (as it should be), follo

Problems with OthAuth - unintended recursion in model?

2006-07-16 Thread M
investigating this I printed out the $_SESSION and discovered something a bit disturbing - it appears that there is some unintended recursion happening, so in the session you get the desired user, which contains group which contains permissions (up to now, all is good but...)... and permission

  1   2   >