<?php



namespace Ballybran\Database\Drives;

use PDO;

/**
 * ImageInterface AbstractDatabaseInterface
 * @package Ballybran\Database\Drives
 */
interface AbstractDatabaseInterface
{

    /**
     *
     */
    const HOST = "localhost";
    /**
     *
     */
    const UNAME = "root";
    /**
     *
     */
    const PW = "root";
    /**
     *
     */
    const DBNAME = "";


    /**
     * @param $sql
     * @param array $array
     * @param int $fetchMode
     * @return mixed
     */
    public function selectManager($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC);


    /**
     * @param $table
     * @param null $fields
     * @param null $where
     * @param null $order
     * @param null $limit
     * @param null $offset
     * @param array $array
     * @param $fetchMode
     * @return mixed
     */
    public function find(string $table, string $fields = null, string $where = null, string $order = null, int $limit = null, $offset = null, array $array = array(), $fetchMode = \PDO::FETCH_ASSOC);


    /**
     * @param $table
     * @param $data
     * @param bool $isId
     * @param null $where
     * @return mixed
     */
    public function save($table, $data, $isId = false, $where = null);


    /**
     * @param $table
     * @param array $data
     * @return mixed
     */
    public function insert($table, array $data);

    /**
     * @param $table
     * @param $data
     * @param $where
     * @return bool
     */
    public function update($table, $data, $where);

    /**
     * @param $table
     * @param $where
     * @param $limit
     * @return mixed
     */
    public function delete($table, $where, $limit = 1);


}
