<?php

namespace App\Services;

use App\Repositories\ProducerRepository;
use App\Repositories\ProducerRepositoryInterface;

class ProducerService
{
    protected ProducerRepository $ProducerRepository;

    public function __construct(ProducerRepositoryInterface $ProducerRepository)
    {
        $this->ProducerRepository = $ProducerRepository;
    }

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

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

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

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