<?php

namespace domain\User\UserUserGroup;

use domain\User\User\User;
use domain\_\AbstractRepositoryQuery;

class UserUserGroupRepositoryQuery extends AbstractRepositoryQuery
{
    protected UserUserGroupDefinition $definition;

    public function loadDependencies(): void
    {
        $this->loadDefinition(UserUserGroupDefinition::class);
    }

    public function filterByUser(User $user): self
    {
        $this->andWhere(['id_user' => $user->id]);
        return $this;
    }
}