Help for this page

Select Code to Download


  1. or download this
    select * from users join user_roles on (user_roles. user_id = id) join
    + roles on (roles.id = role_id) where username like '%foo%';
    
  2. or download this
    #You may well note from my code below that my use of DBIx::Class is th
    +rough the Catalyst framework.
    # The code below fails with a very long stack trace which basically sa
    +ys that my SQL syntax is wrong.
    ...
                   },
                   { rows => 10 }
                );
    
  3. or download this
    package CTIweb::Schema::DB::Users;
    use strict;
    ...
    __PACKAGE__->has_many(map_user_role => 'CTIweb::Schema::DB::UserRoles'
    +, 'user_id');
    __PACKAGE__->many_to_many(roles => 'map_user_role', 'role');
    1;
    
  4. or download this
    package CTIweb::Schema::DB::Roles;
    use strict;
    ...
    __PACKAGE__->has_many(map_user_role => 'CTIweb::Schema::DB::UserRoles'
    +, 'role_id');
    __PACKAGE__->has_many(map_acl_role => 'CTIweb::Schema::DB::AclRoles', 
    +'role_id');
    1;
    
  5. or download this
    package CTIweb::Schema::DB::UserRoles;
    use strict;
    ...
    __PACKAGE__->belongs_to(user => 'CTIweb::Schema::DB::Users', 'user_id'
    +);
    __PACKAGE__->belongs_to(role => 'CTIweb::Schema::DB::Roles', 'role_id'
    +);
    1;