Skip to content

Commit 8e3c8ea

Browse files
committed
relation
1 parent 9456acd commit 8e3c8ea

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

src/lib/Models/Comment.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
use Takuya\BacklogApiClient\Models\User;
99
use Takuya\BacklogApiClient\Models\Star;
1010
use Takuya\BacklogApiClient\Models\CommentNotification;
11-
use Takuya\BacklogApiClient\Models\Traits\HasStar;
12-
1311
class Comment extends BaseModel {
1412

1513
use HasID;
14+
use HasProjectId;
1615
use HasIssueId;
17-
use HasStar;
1816
public ?string $content;
1917
public ?array $changeLog;
2018
/** @var object|User */
@@ -23,6 +21,6 @@ class Comment extends BaseModel {
2321
public string $updated;
2422
/** @var array | Star[] */
2523
public array $stars;
26-
/** @var array | CommentNotification[] */
24+
/** @var array | CommentNotification[] */
2725
public array $notifications;
2826
}

src/lib/Models/CommentNotification.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class CommentNotification extends BaseModel {
3434
'プルリクエストの更新' => 13,
3535
];
3636
use HasID;
37-
use RelateToIssue;
3837
use RelateToComment;
3938
public bool $alreadyRead;
4039
public int $reason;

src/lib/Models/Traits/RelateToComment.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ public function relation($parent=null):void{
1616
parent::relation($parent);
1717
$this->commentId = $parent->commentId ?? $parent->id ?? null;
1818
}
19-
2019
}

src/lib/Models/Traits/RelateToIssue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ public function getIssueId():int{
99
}
1010
public function relation($parent=null):void{
1111
parent::relation($parent);
12-
$this->issue_id = $parent->issueId ?? $parent->id ?? null;
12+
$this->issue_id = $parent->issueId ?? $parent->issue_id?? $parent->id ?? null;
1313
}
1414
}

0 commit comments

Comments
 (0)