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

createWithValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 10
nc 1
nop 4
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