Commit a34d7471473ee66cfe3c430c30225382c58dafd3
1 parent
73983f4d
bug fix
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
models/CommentModel.php
| @@ -406,5 +406,23 @@ | @@ -406,5 +406,23 @@ | ||
| 406 | return 'artbox\order\models\Customer'; | 406 | return 'artbox\order\models\Customer'; |
| 407 | } | 407 | } |
| 408 | } | 408 | } |
| 409 | + /** | ||
| 410 | + * @return bool|\yii\db\ActiveQuery | ||
| 411 | + */ | ||
| 412 | + public function getEntityQuery() | ||
| 413 | + { | ||
| 414 | + if (method_exists($this->entity, 'find')) { | ||
| 415 | + $query = call_user_func_array( | ||
| 416 | + [ | ||
| 417 | + $this->entity, | ||
| 418 | + 'find', | ||
| 419 | + ], | ||
| 420 | + [] | ||
| 421 | + ); | ||
| 422 | + return $query->where([ 'id' => $this->entity_id ]); | ||
| 423 | + } else { | ||
| 424 | + return false; | ||
| 425 | + } | ||
| 426 | + } | ||
| 409 | } | 427 | } |
| 410 | 428 | ||
| 411 | \ No newline at end of file | 429 | \ No newline at end of file |