<?php

declare(strict_types=1);

namespace App\Framework\Database;

use App\Framework\Database\Criteria\Criteria;

interface EntityLoaderInterface
{
    /**
     * Find entity by primary key
     */
    public function find(string $entityClass, mixed $id): ?object;

    /**
     * Find single entity by criteria using Value Objects
     */
    public function findOneByCriteria(Criteria $criteria): ?object;

    /**
     * Find multiple entities by criteria using Value Objects
     */
    public function findByCriteria(Criteria $criteria): array;

    /**
     * @deprecated Use findOneByCriteria() with DetachedCriteria instead
     * Find single entity by criteria
     */
    public function findOneBy(string $entityClass, array $criteria): ?object;

    /**
     * @deprecated Use findByCriteria() with DetachedCriteria instead
     * Find multiple entities by criteria
     */
    public function findBy(string $entityClass, array $criteria): array;
}
