<?php

namespace App\Services;

use App\Repositories\ContactRepository;
use App\Repositories\ContactRepositoryInterface;

class ContactService
{
    protected ContactRepository $ContactRepository;

    public function __construct(ContactRepositoryInterface $ContactRepository)
    {
        $this->ContactRepository = $ContactRepository;
    }

    /**
     * Get's a record by it's ID
     *
     * @param int
     */
    public function get($id): collection
    {
        return $this->ContactRepository->get($id);
    }

    /**
     * Get's all records.
     *
     * @return mixed
     */
    public function all()
    {
        return $this->ContactRepository->all();
    }

    /**
     * Deletes a record.
     *
     * @param int
     */
    public function delete($id)
    {
        return $this->ContactRepository->delete($id);
    }

    /**
     * Updates a post.
     *
     * @param int
     * @param array
     */
    public function update($id, array $data)
    {
        $this->ContactRepository->update($id, $data);
    }
}
