Completed
Push — api_content_name_shorthand ( 929e38...fc49b1 )
by André
20:47
created

Field   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 56
rs 10
c 1
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __clone() 0 4 1
1
<?php
2
3
/**
4
 * File containing the (content) Field class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\SPI\Persistence\Content;
10
11
use eZ\Publish\SPI\Persistence\ValueObject;
12
13
class Field extends ValueObject
14
{
15
    /**
16
     * Field ID.
17
     *
18
     * @var mixed
19
     */
20
    public $id;
21
22
    /**
23
     * Corresponding field definition.
24
     *
25
     * @var mixed
26
     */
27
    public $fieldDefinitionId;
28
29
    /**
30
     * Data type name.
31
     *
32
     * @var string
33
     */
34
    public $type;
35
36
    /**
37
     * Value of the field.
38
     *
39
     * @var \eZ\Publish\SPI\Persistence\Content\FieldValue
40
     */
41
    public $value;
42
43
    /**
44
     * Language code of this Field.
45
     *
46
     * @var string
47
     */
48
    public $languageCode;
49
50
    /**
51
     * @var int|null Null if not created yet
52
     *
53
     * @todo Normally we would use a create struct here
54
     */
55
    public $versionNo;
56
57
    /**
58
     * Clone object properties.
59
     *
60
     * Note: `clone` keyword performs shallow copy of an object.
61
     * For properties being objects this means that a reference
62
     * is copied instead of the actual object.
63
     */
64
    public function __clone()
65
    {
66
        $this->value = clone $this->value;
67
    }
68
}
69