Completed
Push — master ( c29406...3a3831 )
by vistart
05:37
created

BaseMongoMessageModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 18
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 3
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.name/
9
 * @copyright Copyright (c) 2016 vistart
10
 * @license https://vistart.name/license/
11
 */
12
13
namespace vistart\Models\models;
14
15
use vistart\Models\queries\BaseMongoMessageQuery;
16
use vistart\Models\traits\MessageTrait;
17
18
/**
19
 * Description of BaseMongoMessageModel
20
 *
21
 * @author vistart <[email protected]>
22
 */
23
abstract class BaseMongoMessageModel extends BaseMongoBlameableModel
24
{
25
    use MessageTrait;
26
27
    public $updatedByAttribute = false;
28
29 1
    public function init()
30
    {
31 1
        if (!is_string($this->queryClass)) {
32 1
            $this->queryClass = BaseMongoMessageQuery::className();
33 1
        }
34 1
        if ($this->skipInit) {
35 1
            return;
36
        }
37 1
        $this->initMessageEvents();
38 1
        parent::init();
39 1
    }
40
}
41