Completed
Push — master ( 7a069b...4da1f4 )
by Paweł
11s
created

Route::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 1
cts 2
cp 0.5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1.125
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\CoreBundle\Model;
16
17
use SWP\Bundle\ContentBundle\Model\RouteInterface;
18
use SWP\Component\MultiTenancy\Model\TenantAwareInterface;
19
use SWP\Component\MultiTenancy\Model\TenantAwareTrait;
20
use SWP\Bundle\ContentBundle\Model\Route as BaseRoute;
21
22
/**
23
 * Class Route.
24
 */
25
class Route extends BaseRoute implements RouteInterface, TenantAwareInterface, ArticlesCountInterface
26
{
27
    use TenantAwareTrait, ArticlesCountTrait;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function serialize()
33
    {
34
        $parentSerializedData = unserialize(parent::serialize());
35
        $parentSerializedData['id'] = $this->getId();
36
37
        return serialize($parentSerializedData);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function unserialize($serialized)
44
    {
45
        parent::unserialize($serialized);
46
47
        $data = unserialize($serialized);
48
        $this->id = $data['id'];
49
    }
50
}
51