Good post..I have same problem...It's working but in my case
entity_type_id is not saving in entities_tags tabel...
Currently I am using it only in
*Teacher Model*
?php
class Teacher extends AppModel {
var $name = 'Teacher';
var $hasAndBelongsToMany = array(
'Tag' =
Hi,
If i did understand what you are trying to achive you could design
your tag relationship in the following way:
Tables
---
Tags
id
name
model
created
updated more if needed etc...
then you would have a linking table which would link tags to its
repective associated model.
This does not serve the purpose because tagging needs to be
implemented on all the 3 types of entities : Posts, Teachers and
Books .
On Nov 1, 11:15 pm, Anupom [EMAIL PROTECTED] wrote:
Please find my suggested db design below,
tags: id, name
types: id, name
posts: id, name
teachers: id,
Sorry I got it wrong in hurry :) Can you please check out the following
schema again?
tags: id, name
entity_types: id, name [(0, Posts), (1, Teachers), (2, Books)]
posts: id, name
teachers: id, name
books: id, name
entities_tags: id, entity_id, entity_type_id, tag_id
With this schema please
Please find my suggested db design below,
tags: id, name
types: id, name
posts: id, name
teachers: id, name
books: id, name, type_id
books_tags: id, book_id, tag_id
All ids are auto increment primary fields.
So if, the book with (id, name, type_id) = (6, 'Bookname', 2) has two tags
with (id,