• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help

#1
[eluser]Unknown[/eluser]
It is related to datamapper ORM

Rights: var $has_many = array("roles"); - it has rights entered in table
Role: var $has_many = array("rights"); - it has rights entered in table

Relation will be roles_rights

What I am doing is I am setting perimssion for one of my role say manager
Code:
Controller
   insertAction   Radiobutton1 Radiobutton2
   deleteAction   Radiobutton1 Radiobutton2

When I click on save button it should save in relation table, roles_rights. But is is not happening. Can anyone figure out what the problem is?

I am not able to save the data.


Actual code

Code:
$role = new Role();
  $role->where('id',(int)$this->input->post('id'))->get();
  $exists = $role->exists();
  if($exists){
   $right = new Right();
   $right->role_id = 18;
   $right->right_id = 1;
   $right->permission = 1;
   $isSaved = $role->save($right);
   echo "Saved";
  }else{
   echo "No Saved";
  }

Thanks


Messages In This Thread
Please help - by El Forum - 05-02-2012, 03:44 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.