<?php

namespace common\logic\User\UserUserGroup\Repository;

use common\logic\AbstractRepositoryQuery;
use common\logic\User\User\Model\User;
use common\logic\User\UserUserGroup\Model\UserUserGroup;
use common\logic\User\UserUserGroup\Service\UserUserGroupDefinition;
use yii\db\ActiveQuery;

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;
    }
}