<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\MainBundle\Repository;

use Chill\MainBundle\Entity\UserJob;
use Doctrine\Persistence\ObjectRepository;

/**
 * @template-extends ObjectRepository<UserJob>
 */
interface UserJobRepositoryInterface extends ObjectRepository
{
    public function find($id): ?UserJob;

    public function findAll(): array;

    public function findAllActive(): array;

    /**
     * a list of UserJob ordered by name.
     *
     * @return array<UserJob>
     */
    public function findAllOrderedByName(): array;

    /**
     * Find all the user job which are not related to a UserGroup.
     *
     * This is useful for synchronizing UserGroups with jobs.
     *
     * @return list<UserJob>
     */
    public function findAllNotAssociatedWithUserGroup(): array;

    public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null);

    public function findOneBy(array $criteria): ?UserJob;

    public function getClassName(): string;
}
