I have one problem pls help.
i have 3 tables users,roles,users_roles and thier models are
(User,Role,UsersRole)
a user has and belongs to many roles for that i have done intersecting
the other models in user model(user.php) in this way.
var $hasAndBelongsToMany = array(
'Role' =>
array('className' => 'Role',
'joinTable' => 'users_roles',
'foreignKey' => 'user_id',
'associationForeignKey' => 'role_id',
'conditions' => '',
'order' => '',
'limit' => '',
'unique' => true,
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);
In my users_contoller i have just written
function index()
{
$this->set('users', $this->User->findAll("username!
='admin'"));
}
this intersection works fine when i use in cakephp 1.1x when i print
the array print_r($users); it will print all the user info with
associated roles.
but when i use the same in cakephp1.2.x its not working when i print
the array print_r($users); its just printing the user info and the
associated roles are missing .
how can i get the user associated roles? do any thing iam missing in
configuration?but i working on same server and i installed both
packages cakephp1.1.x and cakephp1.2.x on same machine which same
environment.
and for me its not working in cakephp1.2.x?any reason
any help in this issue will be appreciated.
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment