Sorry. By the way I write is correct. I tested with other code.
But, I use this thread to ask something:
I make the relation spec before, but I like recursive only in a
UsersProjectsPermission when findAll Projects for exemple.
Using:
$this->Project->UsersProjectsPermission->recursive = 3;
$this->Project->findAll(array('Project.id' => 1));
This exemple doesn't work. Only if I make recursive = 3 for the
project. But Projects hasMany others tables and generated various
selects uneeded. I don't like unbind the hasMany associations.
Thanks.
Juan Basso
On 10 jan, 23:17, Juan Basso <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm tring create a HABTM with 3 models. The case is: I have three
> tables: Users, Projects, Permissions. A user have some permissions in
> a determined project. For exemple, I (user) can read and write
> (permission) on project A (project), but can't write (permission) in
> project B (project).
>
> For this, I create four tables on database:
> - users (id, username, password);
> - projects (id, name);
> - permissions (id, description);
> - users_projects_permissions (id, user_id, project_id, permission_id);
>
> Creating the Model's files, I make:
> - For User, Project and Permission:
> hasMany('UsersProjectsPermission');
> - For UsersProjectsPermission: belongsTo('User', 'Project',
> 'Permission');
>
> But, when I execute my controller that use one of this tables, show
> error: "Error: Database table users_users_projects_permissions for
> model UsersUsersProjectsPermission was not found."
>
> It's need make onde HABTM? Who?
>
> What's wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---