MontealegreLuis/php-testing-tools

View on GitHub
ui/web/src/Ewallet/Memberships/MembersWebRepository.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types=1);
/**
 * PHP version 7.4
 *
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */

namespace Ewallet\Memberships;

use Adapters\Doctrine\Ewallet\Memberships\MembersRepository;

final class MembersWebRepository extends MembersRepository
{
    /** @return Member[] */
    public function excluding(MemberId $senderId): array
    {
        $builder = $this->manager->createQueryBuilder();

        $builder
            ->select('m')
            ->from(Member::class, 'm')
            ->where('m.memberId <> :id')
            ->setParameter('id', $senderId)
        ;

        return $builder->getQuery()->getResult();
    }
}