Completed
Push — master ( 584969...3f5763 )
by
unknown
11:30
created

WidgetLeadStatusSelectConverter::getViewValue()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 4
nop 1
1
<?php
2
3
namespace OroCRM\Bundle\SalesBundle\Dashboard\Converters;
4
5
use Oro\Bundle\DashboardBundle\Provider\Converters\WidgetEntitySelectConverter;
6
7
use OroCRM\Bundle\SalesBundle\Entity\LeadStatus;
8
9
class WidgetLeadStatusSelectConverter extends WidgetEntitySelectConverter
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getViewValue($value)
15
    {
16
        $entities = $this->getEntities($value);
17
18
        $names = [];
19
        /** @var LeadStatus $entity */
20
        foreach ($entities as $entity) {
21
            $names[] = $entity->getLabel();
22
        }
23
24
        return empty($names) ? null : implode('; ', $names);
25
    }
26
}
27