Passed
Push — master ( e157d2...b7d807 )
by Julito
12:22
created

MessageRepository::getFromLastOneReceived()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 21
rs 9.8666
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Repository;
8
9
use Chamilo\CoreBundle\Entity\Message;
10
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
11
use Doctrine\Persistence\ManagerRegistry;
12
13
class MessageRepository extends ServiceEntityRepository
14
{
15
    public function __construct(ManagerRegistry $registry)
16
    {
17
        parent::__construct($registry, Message::class);
18
    }
19
20
    public function update(Message $message, $andFlush = true): void
21
    {
22
        $this->getEntityManager()->persist($message);
23
        if ($andFlush) {
24
            $this->getEntityManager()->flush();
25
        }
26
    }
27
}
28