Completed
Pull Request — develop (#359)
by Mathias
23:51
created

ImageTrait::belongsTo()   A

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 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2017 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Core\Entity;
12
13
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
14
15
/**
16
 * Implements \Core\Entity\ImageInterface
17
 * 
18
 * @author Mathias Gelhausen <[email protected]>
19
 * @since 0.29
20
 */
21
trait ImageTrait
22
{
23
    /**
24
     * Id of the image set.
25
     *
26
     * @ODM\Field(type="string")
27
     * @var string
28
     */
29
    protected $belongsTo;
30
31
    /**
32
     * Key name in the set.
33
     *
34
     * @ODM\Field
35
     * @var string
36
     */
37
    protected $key;
38
39
    /**
40
     * @param string $imageSetId
41
     *
42
     * @return self
43
     */
44
    public function setBelongsTo($imageSetId)
45
    {
46
        $this->belongsTo = $imageSetId;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function belongsTo()
55
    {
56
        return $this->belongsTo;
57
    }
58
59
    /**
60
     * @param string $key
61
     *
62
     * @return self
63
     */
64
    public function setKey($key)
65
    {
66
        $this->key = $key;
67
68
        return $this;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getKey()
75
    {
76
        return $this->key;
77
    }
78
}
79