GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( dba612...b06310 )
by Mario
05:16
created

EzInfoCollectionAttributeRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 7
dl 0
loc 45
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 4 1
A save() 0 5 1
A createWithValues() 0 13 1
1
<?php
2
3
namespace Netgen\Bundle\InformationCollectionBundle\Repository;
4
5
use Doctrine\ORM\EntityRepository;
6
use eZ\Publish\API\Repository\Values\Content\Content;
7
use eZ\Publish\API\Repository\Values\Content\Location;
8
use Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollection;
9
use Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollectionAttribute;
10
use Netgen\Bundle\InformationCollectionBundle\Value\LegacyData;
11
12
class EzInfoCollectionAttributeRepository extends EntityRepository
13
{
14
    /**
15
     * Get new EzInfoCollectionAttribute instance.
16
     *
17
     * @return EzInfoCollectionAttribute
18
     */
19
    public function getInstance()
20
    {
21
        return new EzInfoCollectionAttribute();
22
    }
23
24
    /**
25
     * Save object.
26
     *
27
     * @param EzInfoCollectionAttribute $infoCollectionAttribute
28
     */
29
    public function save(EzInfoCollectionAttribute $infoCollectionAttribute)
30
    {
31
        $this->_em->persist($infoCollectionAttribute);
32
        $this->_em->flush($infoCollectionAttribute);
33
    }
34
35
    /**
36
     * @param Location $location
37
     * @param EzInfoCollection $ezInfoCollection
38
     * @param $fieldId
39
     * @param LegacyData $value
40
     *
41
     * @return EzInfoCollectionAttribute
42
     */
43
    public function createWithValues(Location $location, EzInfoCollection $ezInfoCollection, $fieldId, LegacyData $value)
44
    {
45
        $ezInfoAttribute = $this->getInstance();
46
        $ezInfoAttribute->setContentObjectId($location->getContentInfo()->id);
47
        $ezInfoAttribute->setInformationCollectionId($ezInfoCollection->getId());
48
        $ezInfoAttribute->setContentClassAttributeId($value->getContentClassAttributeId());
49
        $ezInfoAttribute->setContentObjectAttributeId($fieldId);
50
        $ezInfoAttribute->setDataInt($value->getDataInt());
51
        $ezInfoAttribute->setDataFloat($value->getDataFloat());
52
        $ezInfoAttribute->setDataText($value->getDataText());
53
54
        return $ezInfoAttribute;
55
    }
56
}
57