Where would it be usefull?
For example, if i have tags for producs, and tags for posts, i have to created a join table and the tags table for each table i want to use the tags. In the way i am using today (with my modified AppModel), i have only one join table and only one tags table for both tables (posts and products), and in the joinning i use from_uid and to_uid fields to relate them, works perfect, the products table has it´s uid field, wich will never conflicts with uid from posts table, because this value is always unique.
Maybe for a better understanding, the simple schema i´ve created explains better (Yes, i have only ONE join table for all HABTM relationships, using always "from_uid and to_uid" as foreignKey and association key)
[Table posts]
id (int)
title (varchar)
content (text)
uid (varchar)
[Table products]
id (int)
name (varchar)
description (text)
uid (varchar)
[Table tags]
id (int)
tag (varchar)
uid (varchar)
[Table join]
id (int)
from_uid (varchar)
to_uid (varchar)
So, what you people think about this?
-- Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
No comments:
Post a Comment