CreateCurrentBarcampData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 20 1
1
<?php
2
3
namespace BCRM\BackendBundle\DataFixtures\ORM;
4
5
use Carbon\Carbon;
6
use Doctrine\Common\DataFixtures\FixtureInterface;
7
use Doctrine\Common\Persistence\ObjectManager;
8
9
use BCRM\BackendBundle\Entity\Event\Event;
10
11
class CreateCurrentBarcampData implements FixtureInterface
12
{
13
    /**
14
     * {@inheritDoc}
15
     */
16
    public function load(ObjectManager $manager)
17
    {
18
        $nextBcrm = new Event();
19
        $nextBcrm->setCapacity(400);
20
        $startDate         = Carbon::create()->addDays(30);
21
        $endDate           = Carbon::create()->addDays(31);
22
        $registrationStart = Carbon::create();
23
        $nextBcrm->setName(sprintf(
24
            'BarCamp %s %s/%s',
25
            $startDate->format('Y'),
26
            $startDate->format('d.'),
27
            $endDate->format('d.m.Y')
28
        ));
29
        $nextBcrm->setStart($startDate);
30
        $nextBcrm->setRegistrationStart($registrationStart);
31
        $nextBcrm->setRegistrationEnd($endDate);
32
        $nextBcrm->setPrice(1000);
33
        $manager->persist($nextBcrm);
34
        $manager->flush();
35
    }
36
}
37