Provider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getElement() 0 3 1
A tableName() 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 Provider record.
18
 * @property int    $id
19
 * @property string $name
20
 * @property string $type
21
 * @property string $handle
22
 * @property string $clientId
23
 * @property string $clientSecret
24
 * @property string $fieldMapping
25
 */
26
27
class Provider extends ActiveRecord
28
{
29
    use SoftDeleteTrait;
30
31
    /**
32
     * @inheritdoc
33
     *
34
     * @return string
35
     */
36
    public static function tableName(): string
37
    {
38
        return '{{%enupalsocializer_providers}}';
39
    }
40
41
    /**
42
     * Returns the entry’s element.
43
     *
44
     * @return ActiveQueryInterface The relational query object.
45
     */
46
    public function getElement(): ActiveQueryInterface
47
    {
48
        return $this->hasOne(Element::class, ['id' => 'id']);
49
    }
50
}