isJoinUserMerchants) { $this->isJoinUserMerchants = true; return $this ->innerJoin('.userMerchants', 'userMerchants'); } return $this; } public function filterMerchantIsActive(): self { $this->joinUserMerchants(); return $this ->andWhere('userMerchants.active = 1'); } public function filterByMerchant(Merchant $merchant): self { $this->joinUserMerchants(); return $this ->andWhere('userMerchants.merchant = :merchant') ->setParameter('merchant', $merchant); } }