EventManager::getSupport()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Manager;
4
5
use Starkerxp\CampaignBundle\Entity\Event;
6
use Starkerxp\StructureBundle\Entity\AbstractEntity;
7
use Starkerxp\StructureBundle\Manager\AbstractManager;
8
9
class EventManager extends AbstractManager
10
{
11
12
    public function getSupport(AbstractEntity $object)
13
    {
14
        return $object instanceof Event;
15
    }
16
17
    public function toArray(Event $object, $fields = [])
18
    {
19
        $array = [
20
            "id" => $object->getId(),
21
            "campaign_id" => $object->getCampaign()->getId(),
22
            "template_id" => $object->getTemplate()->getId(),
23
        ];
24
25
        return $this->exportFields($array, $fields);
26
    }
27
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
28