DealerShedules   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 11 1
A getDayFormated() 0 4 2
1
<?php
2
3
namespace Dealer\Model;
4
5
use Dealer\Model\Base\DealerShedules as BaseDealerShedules;
6
use Propel\Runtime\Map\TableMap;
7
8
class DealerShedules extends BaseDealerShedules
9
{
10
    protected $days = [
11
        "Monday",
12
        "Tuesday",
13
        "Wednesday",
14
        "Thursday",
15
        "Friday",
16
        "Saturday",
17
        "Sunday"
18
    ];
19
20
    /**
21
     * @inheritDoc
22
     */
23
    public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
24
    {
25
        $result = parent::toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, $includeForeignObjects);
26
        $result["dayFormated"] = $this->getDayFormated();
27
        $result["beginFormated"] = $this->getBegin("H:i");
28
        $result["endFormated"] = $this->getEnd("H:i");
29
        $result["periodBeginFormated"] = $this->getPeriodBegin("Y-m-d");
30
        $result["periodEndFormated"] = $this->getPeriodEnd("Y-m-d");
31
32
        return $result;
33
    }
34
35
    public function getDayFormated()
36
    {
37
        return isset($this->days[$this->getDay()]) ? $this->days[$this->getDay()] : null;
38
    }
39
}
40