Provider::getElement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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
}