What have you tried so far?
On Fri, Apr 6, 2012 at 5:10 AM, Reza Talamkhani
wrote:
> Hi
> I need to create a 'posts' table in db and show related posts to users...
> need to self join and HABTM (hasAndBelongsToMany) relation...
> please help me
>
> --
> Our newest site for the community: CakePHP
Hi
I need to create a 'posts' table in db and show related posts to users...
need to self join and HABTM (hasAndBelongsToMany) relation...
please help me
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakep
@gmail.com"
wrote:
Hi
I'm working on a legacy system , i must to defina an HABTM relation
between User and Group. In User model I have this:
var $hasAndBelongsToMany=array(
'Group' =>array(
'className'
d table.
>
> I guess.
>
> cheers
> Lorenzo
>
>
>
> marco.rizze...@gmail.com wrote:
> > Is there someone that can help me about this?
>
> > On 2 Feb, 19:02, "marco.rizze...@gmail.com"
> > wrote:
> >> Hi
> >> I'm working
right name for the used table.
I guess.
cheers
Lorenzo
marco.rizze...@gmail.com wrote:
Is there someone that can help me about this?
On 2 Feb, 19:02, "marco.rizze...@gmail.com"
wrote:
Hi
I'm working on a legacy system , i must to defina an HABTM relation
between Use
Is there someone that can help me about this?
On 2 Feb, 19:02, "marco.rizze...@gmail.com"
wrote:
> Hi
> I'm working on a legacy system , i must to defina an HABTM relation
> between User and Group. In User model I have this:
>
> var $hasAndBelongsToMany=a
Hi
I'm working on a legacy system , i must to defina an HABTM relation
between User and Group. In User model I have this:
var $hasAndBelongsToMany=array(
'Group' =>array(
'className'=> 'Group&
Hi!
If i want to add a record to TABLE A, is there an efficient way to add
a record in the JOIN TABLE for many (or all) records in TABLE B?
I try to build a simple task management. An user adds a task and there
will be added a connection to each other user in the same group as the
current user.
solution is here:
articles_controller function add (or edit):
...
foreach($this->data['Category']['Category'] as $num =>
$category){
$this->data['CategoriesModel'][$num]['model_id'] = $this->data
['Article']['id'];
I've found solution with binding models on the fly:
articles_controller function add (and function edit)
...
foreach($this->data['Category']['Category'] as $num => $category){
$this->data['CategoriesModel'][$num]['model_id'] = $this->data
['Article']['id'];
$this->data['Categories
First some introduction...
My implementation:
Category HABTM Article and Article HABTM Category
Category HABTM Gallery and Gallery HABTM Category
Category HABTM Link and Link HABTM Category
Category HABTM Document and Document HABTM Category
...
Database table for joins:
CREATE TABLE IF NOT EXI
t;
> Model "Yuser" -> Table "freyr_users"
> Model "Ypermission" -> Table "freyr_permissions"
>
> I built a join_table like:
>
> Table name: "freyr_objects_permissions"
> object_id | bigint (16)
> permission_id | bigint (16)
&
uot;
Model "Ypermission" -> Table "freyr_permissions"
I built a join_table like:
Table name: "freyr_objects_permissions"
object_id | bigint (16)
permission_id | bigint (16)
I have set up my "Yuser <-> YPermission" HABTM relation this way:
var $hasAn
I've just checked the content of the $this->data variable which is saved by
the edit function in the controller.. It contains all changes!! but somehow
the $this->DictWord->save($this->data) function just saves the HABTM
relation and ignores the other fields!
Any ideas?
--
ction, e.g. if you view the word "cake", there should be a field named
"see also" that refers to "baker", "recipe",.. I hope you see what I mean)
So here's what I've done:
- created a database table called "dict_words_dict_words" with t
']['user_id'];
>
> > $this->User->UserSlot->create();
>
> > if ($this->User->UserSlot->save($this->data
> > ['UserSlot'])) {
> > $user_slot_id = $this->User->Use
stInsertId();
>
>
> Basically I create the user, get the user ID, set the UserSlot's
> user_id, and save the UserSlot ...
>
> So as long as you set the data for the HATBM id's correctly, the rows
> will be created.
>
> On Dec 3, 9:57 am, Zeugme <[EMAIL PROTECTE
the user ID, set the UserSlot's
user_id, and save the UserSlot ...
So as long as you set the data for the HATBM id's correctly, the rows
will be created.
On Dec 3, 9:57 am, Zeugme <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How to add an item to a HABTM relation ?
>
> I have
Hi,
How to add an item to a HABTM relation ?
I have a Person and I have to add a Contract to that person.
Here are the data on a view :
data[Contract][type] : 12
data[Contract][name] : contract-AAaa
data[Contract][Person] : 26 // Should I put the person id here ?? or
something else ??
In
7;
),
'EntityType' => array(
'className' => 'EntityType',
'joinTable' => 'entities_tags',
'foreignKey' => 'entity_id',
'associationForeignKey
Hi,
I have a problem to saving data in HABTM relation ship.
1) tags : tag_id, tag_name .
2) entity_types : entity_type_id, entity_type_name . [(0, Posts),
3) teachers : teacher_id, teacher_name .
4) entities_tags : tag_id, entity_type_id, entity_id .
I am using HABTM relation ship between
HI
I have a HABTM relation between two model that it's defined by a
finderQuery and It hasn't a jointable.
But i get always an error from cake 1.2 that the join table misses.
In cake 1.13 all works perfectly.
How can I do?
--~--~-~--~~~---~--~~
You rec
Hi,
I have two models, Users and Groups. I want to represent the
association Users have Groups. Easy enough HABTM.
However, Groups are using Tree behavior, and I would like to specify
that only Groups below a certain level are returned.
The ways I have come up with to do this are not particular
Hi boyracerr,
Thanks for your help. Cake is effectively amazing!!!
Kind Regards.
On Mar 26, 4:10 am, boyracerr <[EMAIL PROTECTED]> wrote:
> Me again,
>
> As so often, I knew I wanted to use it but needed a helpful post
> laying it out for me in simple terms. Mariano to the rescue!
>
> http://w
Me again,
As so often, I knew I wanted to use it but needed a helpful post
laying it out for me in simple terms. Mariano to the rescue!
http://www.cricava.com/blogs/index.php?blog=6&title=modelizing_habtm_join_tables_in_cakephp_&more=1&c=1&tb=1&pb=1
If you are using 1.2, then just set the table
As so often, stating my problem helped me think of it in a different
way (actually it gave me different phrases to Google for)
Have a look at:
http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/
I think this is what we are both trying to do.
Hi, sorry for jumping in your post, but I think my situation is almost
exactly the same.
Imagine I have a forum application with many forums, so that we have
Users
Forums
A user may be an admin for one forum, a member of another, a moderator
of another. There is a table for Roles.
What is the
Hi logica,
Don't focus on the cohérence of the sample used to explain my needs.
It is just a weird example.
What i need is to know if it is possible when defining a HABTM
relationship to tell cake to resolve also the foreign key contained in
the join table.
Can you help me on this?
Thanks in ad
I suspect that you'd be far better off with role_id in the users
table. Unless it denotes a particular role (among many) that a user
had when making the post.
users belongsTo roles, HABTM posts
posts HABTM users
posts_users (user_id, post_id)
On Tue, Mar 25, 2008 at 5:35 AM, Guillaume Chomat
<
Hi everybody,
Is cake able to read any referenced model in a join table?
Suppose we have three entities table:
- users
- posts
- roles
and a join table:
- posts_users.
The join table posts_users has a field role_id, foreign key to the
roles table.
We have defined the HABTM relationship in the
work the way you want.
Cheers,
Adam
On Dec 1, 8:36 am, Bram <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm baking my first CakePHP project at the moment and I've some newbie
> questions. I'll ask each question in it's own topic.
>
> First of all, I'v
Hi all,
I'm baking my first CakePHP project at the moment and I've some newbie
questions. I'll ask each question in it's own topic.
First of all, I've a model with an habtm relation, let's call this
model Company. The related model is called Specialty. I would like
32 matches
Mail list logo