Completed
Push — master ( ce3ac1...678219 )
by Joachim
19:46 queued 14:03
created

StockMovementRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 26
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A persist() 0 4 1
A flush() 0 4 1
1
<?php
2
3
namespace Loevgaard\DandomainStockBundle\Repository;
4
5
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
6
use Loevgaard\DandomainStockBundle\Entity\StockMovement;
7
8
class StockMovementRepository extends ServiceEntityRepository
9
{
10
    public function create(): StockMovement
11
    {
12
        return new $this->_entityName();
13
    }
14
15
    /**
16
     * @param StockMovement $stockMovement
17
     * @throws \Doctrine\ORM\ORMException
18
     */
19
    public function persist(StockMovement $stockMovement) : void
20
    {
21
        $this->getEntityManager()->persist($stockMovement);
22
    }
23
24
    /**
25
     * @param StockMovement|null $stockMovement
26
     * @throws \Doctrine\ORM\ORMException
27
     * @throws \Doctrine\ORM\OptimisticLockException
28
     */
29
    public function flush(?StockMovement $stockMovement = null) : void
30
    {
31
        $this->getEntityManager()->flush($stockMovement);
32
    }
33
}
34