*/ interface UserRepositoryInterface extends ObjectRepository { public function countBy(array $criteria): int; public function countByActive(): int; public function countByNotHavingAttribute(string $key): int; public function countByUsernameOrEmail(string $pattern): int; /** * Find a list of all users. * * The main purpose for this method is to provide a lightweight list of all users in the database. * * @param string $lang The lang to display all the translatable string (no fallback if not present) * * @return iterable */ public function findAllAsArray(string $lang): iterable; /** * Find a list of permissions associated to each users. * * The main purpose for this method is to provide a lightweight list of all permissions group and center * associated to each user. * * @return iterable */ public function findAllUserACLAsArray(): iterable; /** * @return array|User[] */ public function findByActive(?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; /** * Find users which does not have a key on attribute column. * * @return array|User[] */ public function findByNotHavingAttribute(string $key, ?int $limit = null, ?int $offset = null): array; public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array; public function findOneByUsernameOrEmail(string $pattern): ?User; /** * Get the users having a specific flags. * * If provided, only the users amongst "filtered users" are searched. This * allows to make a first search amongst users based on role and center * and, then filter those users having some flags. * * @param User[] $amongstUsers */ public function findUsersHavingFlags(mixed $flag, array $amongstUsers = []): array; }