|
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
|
|
|
|