Completed
Push — master ( b4f572...d20dd2 )
by Alex
13s queued 11s
created

AbstractFixture::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrineFixtures\Service\Fixture;
6
7
use Arp\LaminasDoctrineFixtures\Service\Repository\ReferenceRepository;
8
9
/**
10
 * @author  Alex Patterson <[email protected]>
11
 * @package Arp\LaminasDoctrineFixtures\Service\Fixture
12
 */
13
abstract class AbstractFixture extends \Doctrine\Common\DataFixtures\AbstractFixture
14
{
15
    /**
16
     * @var ReferenceRepository
17
     */
18
    protected $referenceRepository;
19
20
    /**
21
     * @param ReferenceRepository $referenceRepository
22
     */
23
    public function __construct(ReferenceRepository $referenceRepository)
24
    {
25
        $this->referenceRepository = $referenceRepository;
26
    }
27
28
    /**
29
     * @param string $name
30
     *
31
     * @return bool
32
     */
33
    public function hasCollectionReference(string $name): bool
34
    {
35
        return $this->referenceRepository->hasCollectionReference($name);
36
    }
37
38
    /**
39
     * @param string $name
40
     *
41
     * @return iterable
42
     */
43
    public function getCollectionReference(string $name): iterable
44
    {
45
        return $this->referenceRepository->getCollectionReference($name);
46
    }
47
48
    /**
49
     * @param string   $name
50
     * @param iterable $collection
51
     */
52
    public function setCollectionReference(string $name, iterable $collection): void
53
    {
54
        $this->referenceRepository->setCollectionReference($name, $collection);
55
    }
56
57
    /**
58
     * @param string $name
59
     * @param iterable $collection
60
     */
61
    public function addCollectionReference(string $name, iterable $collection): void
62
    {
63
        $this->referenceRepository->addCollectionReference($name, $collection);
64
    }
65
}
66