NAME

A class for TABLE users in schema main

SYNOPSIS

#a helper from Ado::Plugin::AdoHelpers providing the current user
$app->helper(
    'user' => sub {
        Ado::Model::Users->by_login_name(shift->session->{login_name} // 'guest');
    }
);

DESCRIPTION

This class maps to table users.

ATTRIBUTES

Ado::Model::Users inherits all attributes from Ado::Model provides the following.

name

Readonly. Returns concatenated "first_name" and "last_name" of the user or the username (in case the first two are not available).

# Hello, Guest
<h1>Hello, <%=user->name%>!</h1>

COLUMNS

Each column from table users has an accessor method in this class.

id

group_id

login_name

login_password

first_name

last_name

email

description

created_by

changed_by

tstamp

reg_date

disabled

start_date

stop_date

ALIASES

none

METHODS

Ado::Model::Users inherits all methods from Ado::Model and provides the following.

by_login_name

Selects a user by login_name column.

my $user = Ado::Model::Users->by_login_name('guest');
say $user->login_name if $user->id;

GENERATOR

DBIx::Simple::Class::Schema

SEE ALSO

Ado::Model, DBIx::Simple::Class, DBIx::Simple::Class::Schema