Completed
Push — master ( bf148f...113cf9 )
by vistart
07:06
created

BaseUserRelationGroupModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 38
ccs 5
cts 8
cp 0.625
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 3
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link http://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license http://vistart.me/license/
11
 */
12
13
namespace rhosocial\base\models\models;
14
15
use rhosocial\base\models\queries\BaseBlameableQuery;
16
use rhosocial\base\models\traits\UserRelationGroupTrait;
17
18
/**
19
 * This abstract class is used for building user relation group.
20
 * This model is a record of user relation group, if you want to know the details
21
 * about creating, updating, finding and removing a group, please see [[BaseUserRelationModel]].
22
 *
23
 * $contentAttribute name of user relation group.
24
 * $contentTypeAttribute type of user relation group.
25
 * 
26
 * @version 1.0
27
 * @author vistart <[email protected]>
28
 */
29
abstract class BaseUserRelationGroupModel extends BaseBlameableModel
30
{
31
    use UserRelationGroupTrait;
32
33
    public $confirmationAttribute = false;
34
    public $descriptionAttribute = 'description';
35
    
36
    /**
37
     * @var false This feature does not need to record IP address. 
38
     */
39
    public $enableIP = false;
40
    public $idAttribute = false;
41
    
42
    /**
43
     * @var false This feature does not need to record last update time. 
44
     */
45
    public $updatedAtAttribute = false;
46
    
47
    /**
48
     * @var false This feature does not need to record the user who update this group. 
49
     */
50
    public $updatedByAttribute = false;
51
52
    /**
53
     * @inheritdoc
54
     */
55 16
    public function init()
56
    {
57 16
        if (!is_string($this->queryClass)) {
58 16
            $this->queryClass = BaseBlameableQuery::class;
59
        }
60 16
        if ($this->skipInit) {
61 16
            return;
62
        }
63
        $this->initUserRelationGroupEvents();
64
        parent::init();
65
    }
66
}
67