Commit 0bacad2efd1871ea89e8db01d3604c12444f0abc

Authored by Yarik
1 parent bf5d7e9b

Namespaces

@@ -14,21 +14,19 @@ @@ -14,21 +14,19 @@
14 class Module extends \yii\base\Module 14 class Module extends \yii\base\Module
15 { 15 {
16 16
17 -  
18 -  
19 /** 17 /**
20 * @var string module name 18 * @var string module name
21 */ 19 */
22 public static $name = 'artbox-comment'; 20 public static $name = 'artbox-comment';
23 21
24 /** 22 /**
25 - * User identity class, default to common\models\User 23 + * User identity class, default to artweb\artbox\comment\models\User
26 * @var string|null 24 * @var string|null
27 */ 25 */
28 public $userIdentityClass = NULL; 26 public $userIdentityClass = NULL;
29 27
30 /** 28 /**
31 - * Comment model class, default to common\modules\models\CommentModel 29 + * Comment model class, default to artweb\artbox\comment\modules\models\CommentModel
32 * @var string comment model class 30 * @var string comment model class
33 */ 31 */
34 public $commentModelClass = NULL; 32 public $commentModelClass = NULL;
assets/CommentAsset.php
@@ -39,4 +39,5 @@ @@ -39,4 +39,5 @@
39 'yii\web\JqueryAsset', 39 'yii\web\JqueryAsset',
40 'yii\web\YiiAsset', 40 'yii\web\YiiAsset',
41 ]; 41 ];
42 - }  
43 \ No newline at end of file 42 \ No newline at end of file
  43 + }
  44 +
44 \ No newline at end of file 45 \ No newline at end of file
behaviors/ParentBehavior.php
@@ -38,4 +38,5 @@ @@ -38,4 +38,5 @@
38 } 38 }
39 } 39 }
40 } 40 }
41 - }  
42 \ No newline at end of file 41 \ No newline at end of file
  42 + }
  43 +
43 \ No newline at end of file 44 \ No newline at end of file
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 "require": { 5 "require": {
6 "php": ">=7.0", 6 "php": ">=7.0",
7 "yiisoft/yii2": "*", 7 "yiisoft/yii2": "*",
8 - "developeruz/yii2-db-rbac": "*" 8 + "artweb/artbox": "dev-master"
9 }, 9 },
10 "autoload": { 10 "autoload": {
11 "psr-4": { 11 "psr-4": {
models/CommentModel.php
1 <?php 1 <?php
2 namespace artweb\artbox\comment\models; 2 namespace artweb\artbox\comment\models;
3 3
4 - use common\behaviors\RatingBehavior;  
5 use artweb\artbox\comment\behaviors\ParentBehavior; 4 use artweb\artbox\comment\behaviors\ParentBehavior;
6 use artweb\artbox\comment\models\interfaces\CommentInterface; 5 use artweb\artbox\comment\models\interfaces\CommentInterface;
7 use yii\behaviors\AttributeBehavior; 6 use yii\behaviors\AttributeBehavior;
@@ -147,14 +146,6 @@ @@ -147,14 +146,6 @@
147 [ 146 [
148 'class' => ParentBehavior::className(), 147 'class' => ParentBehavior::className(),
149 ], 148 ],
150 - [  
151 - 'class' => RatingBehavior::className(),  
152 - ],  
153 - /* Notification: uncomment to enable notifications.  
154 - [  
155 - 'class' => NotifyBehavior::className(),  
156 - ],  
157 - */  
158 ]; 149 ];
159 } 150 }
160 151
@@ -271,4 +262,5 @@ @@ -271,4 +262,5 @@
271 ] 262 ]
272 ); 263 );
273 } 264 }
274 - }  
275 \ No newline at end of file 265 \ No newline at end of file
  266 + }
  267 +
276 \ No newline at end of file 268 \ No newline at end of file
models/RatingModel.php
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 2
3 namespace artweb\artbox\comment\models; 3 namespace artweb\artbox\comment\models;
4 4
5 - use common\models\User;  
6 use Yii; 5 use Yii;
7 use yii\behaviors\BlameableBehavior; 6 use yii\behaviors\BlameableBehavior;
8 use yii\behaviors\TimestampBehavior; 7 use yii\behaviors\TimestampBehavior;
@@ -11,6 +10,8 @@ @@ -11,6 +10,8 @@
11 /** 10 /**
12 * This is the model class for table "artbox_comment_rating". 11 * This is the model class for table "artbox_comment_rating".
13 * 12 *
  13 + * @todo Refactor User to Identity
  14 + *
14 * @property integer $artbox_comment_rating_id 15 * @property integer $artbox_comment_rating_id
15 * @property string $created_at 16 * @property string $created_at
16 * @property string $updated_at 17 * @property string $updated_at
@@ -18,7 +19,6 @@ @@ -18,7 +19,6 @@
18 * @property integer $value 19 * @property integer $value
19 * @property string $model 20 * @property string $model
20 * @property integer $model_id 21 * @property integer $model_id
21 - * @property User $user  
22 */ 22 */
23 class RatingModel extends ActiveRecord 23 class RatingModel extends ActiveRecord
24 { 24 {
@@ -79,14 +79,6 @@ @@ -79,14 +79,6 @@
79 ]; 79 ];
80 } 80 }
81 81
82 - /**  
83 - * @return \yii\db\ActiveQuery  
84 - */  
85 - public function getUser()  
86 - {  
87 - return $this->hasOne(User::className(), [ 'id' => 'user_id' ]);  
88 - }  
89 -  
90 public function getModel() 82 public function getModel()
91 { 83 {
92 $model = $this->model; 84 $model = $this->model;