Completed
Push — master ( 2e8a26...a23306 )
by vistart
16:46
created

BaseRedisMessageModel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10

1 Method

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