7 class Account
extends Row
9 function updateToken($authority, $token, $json) {
10 $tokens = $this->table
->getTokens();
12 $existing = $tokens->find([
13 "authority=" => $authority,
14 "account=" => $this->account
,
17 if (count($existing)) {
18 $found = $existing->current();
19 $found->token
= $token;
20 $found->oauth
= $json;
25 return $tokens->create([
26 "authority" => $authority,
27 "account" => $this->account
,
33 function updateOwner($authority, $user, $json) {
34 $owners = $this->table
->getOwners();
36 $existing = $owners->find([
37 "authority=" => $authority,
38 "account=" => $this->account
,
41 if (count($existing)) {
42 $found = $existing->current();
43 $found->login
= $user;
44 $found->owner
= $json;
49 return $owners->create([
50 "authority" => $authority,