<?php

namespace App\Seraph\Repositories\Eloquent;

interface BaseRepositoryInterface
{
    /**
     * Get all the model records in the database.
     *
     * @return \Illuminate\Database\Eloquent\Collection
     */
    public function all();

    /**
     * Count the number of specified model records in the database.
     *
     * @return int
     */
    public function count();

    /**
     * Create a new model record in the database.
     *
     * @param array $data
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function create(array $data);

    /**
     * Delete one or more model records from the database.
     *
     * @return mixed
     */
    public function delete();

    /**
     * Delete the specified model record from the database.
     *
     * @param $id
     *
     * @throws \Exception
     *
     * @return bool|null
     */
    public function deleteById($id);

    /**
     * Delete multiple records from the database.
     *
     * @param  array  $ids
     *
     * @throws \Exception
     *
     * @return bool|null
     */
    public function deleteMultipleById(array $ids);

    /**
     * Get the first specified model record from the database.
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function first();

    /**
     * Get all the specified model records in the database.
     *
     * @return \Illuminate\Database\Eloquent\Collection
     */
    public function get();

    /**
     * Get the specified model record from the database.
     *
     * @param $id
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function getById($id);

    /**
     * Set the query limit.
     *
     * @param int $limit
     *
     * @return $this
     */
    public function limit($limit);

    /**
     * Update the specified model record in the database.
     *
     * @param       $id
     * @param array $data
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function updateById($id, array $data);

    /**
     * Add a simple where clause to the query.
     *
     * @param string $column
     * @param string $value
     * @param string $operator
     *
     * @return $this
     */
    public function where($column, $value, $operator = '=');

    /**
     * Add a simple where in clause to the query.
     *
     * @param string $column
     * @param mixed  $values
     *
     * @return $this
     */
    public function whereIn($column, $values);

    /**
     * Set Eloquent relationships to eager load.
     *
     * @param $relations
     *
     * @return $this
     */
    public function with($relations);
}
