<?php

declare(strict_types=1);

namespace App\Framework\Database\Criteria;

/**
 * Main criteria interface for building database queries
 */
interface Criteria
{
    /**
     * Add a criterion to this criteria
     */
    public function add(Criterion $criterion): self;

    /**
     * Set the projection (SELECT clause)
     */
    public function setProjection(Projection $projection): self;

    /**
     * Add an order by clause
     */
    public function addOrder(Order $order): self;

    /**
     * Set maximum number of results
     */
    public function setMaxResults(?int $maxResults): self;

    /**
     * Set first result offset
     */
    public function setFirstResult(?int $firstResult): self;

    /**
     * Get all criteria (WHERE conditions)
     */
    public function getCriteria(): array;

    /**
     * Get projection
     */
    public function getProjection(): ?Projection;

    /**
     * Get orders
     */
    public function getOrders(): array;

    /**
     * Get max results
     */
    public function getMaxResults(): ?int;

    /**
     * Get first result offset
     */
    public function getFirstResult(): ?int;
}
