Completed
Push — master ( 1e7ae1...1641c1 )
by Axel
04:29
created

NotificationRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 13 1
1
<?php
2
3
namespace App\Repository\User;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class NotificationRepository extends EntityRepository
8
{
9
    public function read(array $ids = [])
10
    {
11
        return $this
12
            ->createQueryBuilder('n')
13
            ->update()
14
            ->set('n.readAt', ':read_at')
15
            ->where('n.id IN (:ids)')
16
            ->setParameters([
17
                'ids' => $ids,
18
                'read_at' => new \DateTime()
19
            ])
20
            ->getQuery()
21
            ->execute()
22
        ;
23
    }
24
}