Re: Extend running blog example: user makes posts with custom set of tags

2008-10-05 Thread teknoid

$this-set('tags', $this-User-Tag-find('list',
array('conditions'=array('Tag.user_id'=$this-Auth-user('id')...

On Oct 4, 1:44 pm, GrandiJoos [EMAIL PROTECTED] wrote:
 Hi all,

 I ran in a HABTM problem which I'll try to translate to the running
 blog example used in the CakePHP documentation.

 Imagine a blog with multiple authors (users) who can post articles and
 add tags to posts. Now assume that each author has its own set of
 tags, this would result in the following relationships:
 User HasMany Posts
 User HasMany Tags
 Posts HABTM Tags (and vice versa).

 Now, when a user creates a post I want to only show his collection of
 tags, how would I do that?
 Can I access the userId stored in the session from the model and
 include it in the HABTM conditional field? Or is there another (neat)
 trick necessary?

 Any help is appreciated!

 GrandiJoos
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Extend running blog example: user makes posts with custom set of tags

2008-10-04 Thread GrandiJoos

Hi all,

I ran in a HABTM problem which I'll try to translate to the running
blog example used in the CakePHP documentation.

Imagine a blog with multiple authors (users) who can post articles and
add tags to posts. Now assume that each author has its own set of
tags, this would result in the following relationships:
User HasMany Posts
User HasMany Tags
Posts HABTM Tags (and vice versa).

Now, when a user creates a post I want to only show his collection of
tags, how would I do that?
Can I access the userId stored in the session from the model and
include it in the HABTM conditional field? Or is there another (neat)
trick necessary?

Any help is appreciated!

GrandiJoos
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---