<?php
/**
 * Repository Interface
 *
 * Base interface for all repository classes
 *
 * @package NemtlyBooking
 * @since   PBOOKING_SINCE
 */

namespace NemtlyBooking\Interfaces;

/**
 * Repository Interface
 *
 * @since PBOOKING_SINCE
 */
interface Repository_Interface {

    /**
     * Find a record by ID
     *
     * @since PBOOKING_SINCE
     *
     * @param int $id Record ID.
     *
     * @return mixed|null Record object or null if not found.
     */
    public function find( $id );

    /**
     * Find all records
     *
     * @since PBOOKING_SINCE
     *
     * @param array $args Query arguments.
     *
     * @return array Array of record objects.
     */
    public function find_all( $args = [] );

    /**
     * Create a new record
     *
     * @since PBOOKING_SINCE
     *
     * @param mixed $data Record data.
     *
     * @return mixed|false Created record object or false on failure.
     */
    public function create( $data );

    /**
     * Update a record
     *
     * @since PBOOKING_SINCE
     *
     * @param int   $id   Record ID.
     * @param array $data Updated data.
     *
     * @return mixed|false Updated record object or false on failure.
     */
    public function update( $id, $data );

    /**
     * Delete a record
     *
     * @since PBOOKING_SINCE
     *
     * @param int $id Record ID.
     *
     * @return bool True on success, false on failure.
     */
    public function delete( $id );

    /**
     * Count records
     *
     * @since PBOOKING_SINCE
     *
     * @param array $args Query arguments.
     *
     * @return int Record count.
     */
    public function count( $args = [] );
}
