Help for this page

Select Code to Download


  1. or download this
    __PACKAGE__->has_many(map_user_role => 'CTIweb::Schema::DB::UserRoles'
    +, 'user_id');
    __PACKAGE__->many_to_many(roles => 'map_user_role', 'role');
    
  2. or download this
    # User
    __PACKAGE__->many_to_many( roles => "user_roles", "role_id" );
    __PACKAGE__->has_many(
    ...
      "CTIweb::Schema::DB::UserRoles",
      { "foreign.user_id" => "self.id" },
    )
    
  3. or download this
    # Role
    __PACKAGE__->has_many(map_user_role => 'CTIweb::Schema::DB::UserRoles'
    +, 'role_id');
    __PACKAGE__->has_many(map_acl_role => 'CTIweb::Schema::DB::AclRoles', 
    +'role_id'); # I'm not dealing with this one below
    ...
      { "foreign.role_id" => "self.id" },
    );
    __PACKAGE__->many_to_many(users => 'user_roles', 'user_id');