Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Contracts/IssueActorModelContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ interface IssueActorModelContract extends ConnectiveContract
{
public function getIssueActorName(): string;

public static function getModelType(): string;

public function getModelId(): int;

/**
* ConnectiveCollection<AIssue>
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* @property string $name
* @property int $id
*/
class User extends Model implements ConnectiveContract, IssueActorModelContract
{
Expand Down Expand Up @@ -43,4 +44,14 @@ public static function searchIssueActor(string $searchTerm): Collection
{
return User::query()->where('name', 'like', '%'.$searchTerm.'%')->get();
}

public static function getModelType(): string
{
return self::class;
}

public function getModelId(): int
{
return $this->id;
}
}