hey Mariano, Just as a heads up, I've been employing your expects method all over the place with great results. Been spending way too much time updating some old code but I just can't help myself.
One thing I noticed this morning, but haven't looked in to in any great detail, is that when using the old method I run in to problems if I have parent child relationship existing within the same Model. e.g. Categories having child categories On a particular page I would like to display all child categories with an associated image, and all products of the category specified (by id). I do not need the product list of the child categories at this time. // this model should grab everything so leave it as is $this->{$this->modelClass}->expects( array( 'EcomCategoryParent', 'EcomCategoryChild', 'EcomProduct', 'EcomImage' ) ); // children we need the image of $this->{$this->modelClass}->EcomCategoryChild->expects( array( 'EcomImage' ) ); // products we want the image of as well $this->{$this->modelClass}->EcomProduct->expects( array( 'EcomImage' ) ); // images we want nothing of $this->{$this->modelClass}->EcomImage->expects(); For some reason, this doesn't return any products for the category being requested even though some do in fact exist. Agin, I haven't had time to look in to it but thought I would let you know. For the moment I'm going to work around it but I'm sure at some stage (when the product list becomes extensive) I will need to find a solution. If I do I will let you know. Thank you again for this great piece of code! cheers, mikee On 17/12/06, Mikee Freedom <[EMAIL PROTECTED]> wrote: > Beautiful! > > Thanks again mate, > mikee > > On 17/12/06, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > > > Article got approved already. > > > > About your way to handle it: it makes sense, having sort of a versioning > > control. Pretty cool. > > > > -MI > > > > --------------------------------------------------------------------------- > > > > Remember, smart coders answer ten questions for every question they ask. > > So be smart, be cool, and share your knowledge. > > > > BAKE ON! > > > > -----Mensaje original----- > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > > de Claudio Poli > > Enviado el: Sábado, 16 de Diciembre de 2006 05:20 a.m. > > Para: cake-php@googlegroups.com > > Asunto: Re: Keeping unbindModel out of your controllers > > > > interesting enough, I'm facing the same problem in my app. > > I'm finishing a project where an user can submit an article, this > > article can have a state, like approved, rejected, deleted, draft, on > > hold. > > I've drawed a workflow, after much pulling my hair out, I ended up > > with this solution: when an user submit a new revision, admins gets > > an email and the edit automatically gets approved. > > this because if a user modify, is correct that the previous version > > is still online, and when admin approves the new, it flips on the old > > version. > > this require an intense database work, since we need to take care > > even of the tags (habtm). > > so I ended up with this solution to keep an online version, that a > > user can modify from two months after the creation date. > > bakery instead, I believe, will change the state of the article upon > > a revision, but if admins don't/won't approve the new version, the > > article isn't published anymore until a new revision. > > my solution require confidence with users that will submit an article > > of course, but for the sake of simplicity to me is the best choice > > for now, until I will implement a versioning system. > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---