<?php

class User extends ActiveRecord\Model {

    static $has_many = array(
        array('user_roles'),
        array('roles', 'through' => 'user_roles')
    );

    static function get_user($id, $session) {
        return self::find(array('id' => $id, 'session' => $session));
    }

    function get_full_name() {
        return $this->first_name . ' ' . $this->last_name;
    }

}
