-
Notifications
You must be signed in to change notification settings - Fork 944
Expand file tree
/
Copy pathOauthClients.php
More file actions
96 lines (81 loc) · 1.78 KB
/
Copy pathOauthClients.php
File metadata and controls
96 lines (81 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
namespace OAuth2\Storage\Phalcon\Models;
use OAuth2\Storage\Phalcon\Phalcon;
class OauthClients extends \Phalcon\Mvc\Model
{
/**
*
* @var string
*/
public $client_id;
/**
*
* @var string
*/
public $client_secret;
/**
*
* @var string
*/
public $redirect_uri;
/**
*
* @var string
*/
public $grant_types;
/**
*
* @var string
*/
public $scope;
/**
*
* @var string
*/
public $user_id;
/**
* Allows to query a set of records that match the specified conditions
*
* @param mixed $parameters
* @return OauthClients[]
*/
public static function find($parameters = null)
{
return parent::find($parameters);
}
/**
* Allows to query the first record that match the specified conditions
*
* @param mixed $parameters
* @return OauthClients
*/
public static function findFirst($parameters = null)
{
return parent::findFirst($parameters);
}
/**
* Initialize method for model.
*/
public function initialize()
{
$this->setSource("'" . $this->getDI()->get(Phalcon::KEY_PHALCON_CONFIG_ARRAY)->getClientTable() . "'");
$this->belongsTo('user_id', 'OAuth2\Storage\Phalcon\Models\OauthUsers', 'username', array("alias" => "User"));
}
/**
* Returns table name mapped in the model.
*
* @return string
*/
public function getSource()
{
return $this->getDI()->get(Phalcon::KEY_PHALCON_CONFIG_ARRAY)->getClientTable();
}
/**
* @param mixed $parameters
* @return OauthUsers
*/
public function getUser($parameters = null)
{
return $this->getRelated('User', $parameters);
}
}