Token   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 3 1
A getElement() 0 3 1
1
<?php
2
/**
3
 * Socializer plugin for Craft CMS 3.x
4
 *
5
 * @link      https://enupal.com/
6
 * @copyright Copyright (c) 2019 Enupal LLC
7
 */
8
9
namespace enupal\socializer\records;
10
11
use craft\db\ActiveRecord;
12
use yii\db\ActiveQueryInterface;
13
use craft\records\Element;
14
use craft\db\SoftDeleteTrait;
15
16
/**
17
 * Class Token record.
18
 * @property int    $id
19
 * @property string $userId
20
 * @property string $providerId
21
 * @property string $accessToken
22
 */
23
24
class Token extends ActiveRecord
25
{
26
    use SoftDeleteTrait;
27
28
    /**
29
     * @inheritdoc
30
     *
31
     * @return string
32
     */
33
    public static function tableName(): string
34
    {
35
        return '{{%enupalsocializer_tokens}}';
36
    }
37
38
    /**
39
     * Returns the entry’s element.
40
     *
41
     * @return ActiveQueryInterface The relational query object.
42
     */
43
    public function getElement(): ActiveQueryInterface
44
    {
45
        return $this->hasOne(Element::class, ['id' => 'id']);
46
    }
47
}