CakePHP hasAndBelongsToMany relationships demystified

2012-07-29 Thread Ralf Rottmann
Hi everybody, After days of trial-and-error and almost giving up, I've managed to get some basic and – as I believe – very common scenarios solved in CakePHP. I was wondering, why the documentation is not clear on these aspects, so I described my findings in a somewhat lengthy blog post. You m

Re: saving HABTM data in a fixture - have to resort to Model::query() to get it done

2012-07-23 Thread Ralf Rottmann
What is in the 'Stuff', 'MoreStuff' and 'StuffToChange' arrays? On Tuesday, July 24, 2012 2:05:40 AM UTC+2, lsiden wrote: > > I created a component test that modifies and saves a model with HABTM > associated data. > > Before I upgraded to CakePHP 2.0, I tried to accomplish this with > unbind

Conceptual questions regarding HABTM relationships!

2012-07-23 Thread Ralf Rottmann
I've been working with CakePHP (2.x) for quite a while and I'm loving it. However, I found some very important aspects covered too briefly in the documentation. When googling around and asking in other forums, I got mixed responses, increasing my feeling of uncertainty even more. I'd like to as

Saving more than one related object in a HABTM scenario

2012-07-23 Thread Ralf Rottmann
Code also available here: http://pastie.org/4308149 My models User and Group share a hasAndBelongsToMany relationship. The following code create the new user, creates the new group and inserts the correct entry into the groups_users join table. This tells me, the relationship is configured corr

CakePHP Session lost / Facebook SDK / Cookies

2012-04-19 Thread Ralf Rottmann
Hi there, I'm using the official Facebook PHP SDK but it seems as if this messes with the Session. Any idea? -- GrandCentrix GmbH Lüderichstrasse 2-4 51105 Köln, Deutschland Amtsgericht Köln | HRB 70119 | Geschäftsführer: R. Freygang, R. Rottmann, M. Willnow | USt.-IdNr.: DE266333969 -- Our

Session lost on redirect

2012-04-19 Thread Ralf Rottmann
Using latest stable version 2.1.1: Having this in the controller that is called first: $this->Session->write('user', $uid); $this->redirect('/home'); and this in HomeController: var_dump($this->Session->read('user'); Problem: The session var in HomeController is no longer set. Instead, a new s

Re: How to find reliable CakePHP freelance developer?

2011-08-20 Thread Ralf Rottmann
Gio, I've built http://gpc.fm a CakePHP site seeing more than 50.000 page views a day. Am available for contract work. Let me know what you need. Best, -Ralf -- Twitter: http://twitter.com/24z | iMessage/Gtalk: r...@24z.me | Skype: ralf.rottmann | Social: http://about.me/24z Sent from my iPh