ArticleRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findOneByArtnum() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace App\Repository;
4
5
use App\Entity\Article;
6
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7
use Doctrine\Persistence\ManagerRegistry;
8
9
/**
10
 * @method Article|null find($id, $lockMode = null, $lockVersion = null)
11
 * @method Article|null findOneBy(array $criteria, array $orderBy = null)
12
 * @method Article[]    findAll()
13
 * @method Article[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
14
 */
15
class ArticleRepository extends ServiceEntityRepository
16
{
17
    public function __construct(ManagerRegistry $registry)
18
    {
19
        parent::__construct($registry, Article::class);
20
    }
21
22
    /**
23
     * @param string $artnum
24
     *
25
     * @return \App\Entity\Article|null
26
     */
27
    public function findOneByArtnum(string $artnum): ?Article
28
    {
29
        return $this->findOneBy(['artnum' => $artnum]);
30
    }
31
32
// /**
33
//  * @return Article[] Returns an array of Article objects
34
//  */
35
    /*
36
    public function findByExampleField($value)
37
    {
38
        return $this->createQueryBuilder('a')
39
            ->andWhere('a.exampleField = :val')
40
            ->setParameter('val', $value)
41
            ->orderBy('a.id', 'ASC')
42
            ->setMaxResults(10)
43
            ->getQuery()
44
            ->getResult()
45
        ;
46
    }
47
    */
48
49
    /*
50
    public function findOneBySomeField($value): ?Article
51
    {
52
        return $this->createQueryBuilder('a')
53
            ->andWhere('a.exampleField = :val')
54
            ->setParameter('val', $value)
55
            ->getQuery()
56
            ->getOneOrNullResult()
57
        ;
58
    }
59
    */
60
}
61