Commit 0bacad2efd1871ea89e8db01d3604c12444f0abc

Authored by Yarik
1 parent bf5d7e9b

Namespaces

Module.php
... ... @@ -14,21 +14,19 @@
14 14 class Module extends \yii\base\Module
15 15 {
16 16  
17   -
18   -
19 17 /**
20 18 * @var string module name
21 19 */
22 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 24 * @var string|null
27 25 */
28 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 30 * @var string comment model class
33 31 */
34 32 public $commentModelClass = NULL;
... ...
assets/CommentAsset.php
... ... @@ -39,4 +39,5 @@
39 39 'yii\web\JqueryAsset',
40 40 'yii\web\YiiAsset',
41 41 ];
42   - }
43 42 \ No newline at end of file
  43 + }
  44 +
44 45 \ No newline at end of file
... ...
behaviors/ParentBehavior.php
... ... @@ -38,4 +38,5 @@
38 38 }
39 39 }
40 40 }
41   - }
42 41 \ No newline at end of file
  42 + }
  43 +
43 44 \ No newline at end of file
... ...
composer.json
... ... @@ -5,7 +5,7 @@
5 5 "require": {
6 6 "php": ">=7.0",
7 7 "yiisoft/yii2": "*",
8   - "developeruz/yii2-db-rbac": "*"
  8 + "artweb/artbox": "dev-master"
9 9 },
10 10 "autoload": {
11 11 "psr-4": {
... ...
models/CommentModel.php
1 1 <?php
2 2 namespace artweb\artbox\comment\models;
3 3  
4   - use common\behaviors\RatingBehavior;
5 4 use artweb\artbox\comment\behaviors\ParentBehavior;
6 5 use artweb\artbox\comment\models\interfaces\CommentInterface;
7 6 use yii\behaviors\AttributeBehavior;
... ... @@ -147,14 +146,6 @@
147 146 [
148 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 262 ]
272 263 );
273 264 }
274   - }
275 265 \ No newline at end of file
  266 + }
  267 +
276 268 \ No newline at end of file
... ...
models/RatingModel.php
... ... @@ -2,7 +2,6 @@
2 2  
3 3 namespace artweb\artbox\comment\models;
4 4  
5   - use common\models\User;
6 5 use Yii;
7 6 use yii\behaviors\BlameableBehavior;
8 7 use yii\behaviors\TimestampBehavior;
... ... @@ -11,6 +10,8 @@
11 10 /**
12 11 * This is the model class for table "artbox_comment_rating".
13 12 *
  13 + * @todo Refactor User to Identity
  14 + *
14 15 * @property integer $artbox_comment_rating_id
15 16 * @property string $created_at
16 17 * @property string $updated_at
... ... @@ -18,7 +19,6 @@
18 19 * @property integer $value
19 20 * @property string $model
20 21 * @property integer $model_id
21   - * @property User $user
22 22 */
23 23 class RatingModel extends ActiveRecord
24 24 {
... ... @@ -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 82 public function getModel()
91 83 {
92 84 $model = $this->model;
... ...