Inherits DataItem.
Definition at line 8 of file api_token.inc.
◆ __construct()
APIToken::__construct |
( |
| ) |
|
Definition at line 30 of file api_token.inc.
34 $this->relations[
"User"] =
$mgr->getUserClass();
36 $this->DataItem(func_get_args());
Provides the interface to the user model for the application.
◆ getToken()
static APIToken::getToken |
( |
|
$token | ) |
|
|
static |
Definition at line 49 of file api_token.inc.
51 $tokens = Query::create(
'APIToken',
"WHERE token=:t AND active=1 AND (expiry_date IS NULL OR expiry_date > NOW()) ORDER BY created_date DESC LIMIT 1")
◆ getUserToken()
static APIToken::getUserToken |
( |
|
$user_id | ) |
|
|
static |
Definition at line 39 of file api_token.inc.
41 $tokens = Query::create(
'APIToken',
"WHERE user_id=:u AND active=1 AND (expiry_date IS NULL OR expiry_date > NOW()) ORDER BY created_date DESC LIMIT 1")
◆ User()
◆ $fields
Initial value:= array("token_id" => 'Number',
"token" => 'String',
"user_id" => 'Number',
"created_date" => 'DateTime',
"expiry_date" => 'DateTime',
"last_access" => 'DateTime',
"active" => 'Boolean')
Definition at line 14 of file api_token.inc.
◆ $pretty_class_name
APIToken::$pretty_class_name = "API Token" |
◆ $primary_key
APIToken::$primary_key = "token_id" |
◆ $related
APIToken::$related = array("User" => '') |
◆ $table
APIToken::$table = "api_token" |
The documentation for this class was generated from the following file:
- C:/code/cms.sonjara.com/cms/components/api/datamodel/api_token.inc