Services
Creation of a service
class ThreadService implements ThreadServiceInterface
{
private ThreadRepositoryInterface $threadRepository;
public function __construct(
ThreadRepositoryInterface $threadRepository,
) {
$this->threadRepository = $threadRepository;
}
public function store(string $name, string $status, string|null $description, string $color, int $channelId)
{
return $this->threadRepository->storeThread($name, $status, $description, $color, $channelId);
}
public function show(Thread $thread)
{
return $thread;
}
public function update(Thread $thread, string $name, string $status, string|null $description, string $color, int $channelId)
{
return $this->threadRepository->updateThread($thread, $name, $status, $description, $color, $channelId);
}
public function destroy(Thread $thread)
{
return $this->threadRepository->destroyThread($thread);
}
public function edit(Thread $thread)
{
return $thread;
}
```Last updated