Completed
Pull Request — development (#812)
by
unknown
04:52
created

CachesEntity::setCacheId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Oc\Entity;
4
5
use Oc\Repository\AbstractEntity;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity(repositoryClass="Oc\Repository\CachesRepository")
10
 */
11
class CachesEntity extends AbstractEntity
12
{
13
    /** @var int */
14
    protected $cache_id;
15
16
    /** @var datetime */
17
    protected $date_Created;
18
19
    /** @var datetime */
20
    protected $last_Modified;
21
22
    /** @var int */
23
    protected $user_Id;
24
25
    /** @var string */
26
    protected $name;
27
28
    /** @var float */
29
    protected $longitude;
30
31
    /** @var float */
32
    protected $latitude;
33
34
    /** @var int */
35
    protected $status;
36
37
    /** @var string */
38
    protected $country;
39
40
    /** @var float */
41
    protected $difficulty;
42
43
    /** @var float */
44
    protected $terrain;
45
46
    /** @var int */
47
    protected $size;
48
49
    /** @var string */
50
    protected $wp_gc;
51
52
    /** @var string */
53
    protected $wp_oc;
54
55
    public function isNew()
56
    : bool
57
    {
58
        return $this->cache_id === null;
59
    }
60
61
    public function isActiveAndFindable()
62
    : bool
63
    {
64
        if ($this->status == 1) {
65
            return true;
66
        } else {
67
            return false;
68
        }
69
    }
70
71
    public function getCacheId()
72
    : int
73
    {
74
        return $this->cache_id;
75
    }
76
77
    public function setCacheId($arg)
78
    {
79
        $this->cache_id = $arg;
80
    }
81
82
    public function getName()
83
    : string
84
    {
85
        return $this->name;
86
    }
87
88
    public function setName($arg)
89
    {
90
        $this->name = $arg;
91
    }
92
93
    public function getUserId()
94
    : string
95
    {
96
        return $this->user_Id;
97
    }
98
99
    public function setUserId($arg)
100
    {
101
        $this->user_Id = $arg;
102
    }
103
104
    public function getGCid()
105
    : string
106
    {
107
        return $this->wp_gc;
108
    }
109
110
    /**
111
     * Set wpGC
112
     * @param string $arg
113
     */
114
    public function setGCid($arg)
115
    {
116
        $this->wp_gc = $arg;
117
    }
118
119
    public function getOCid()
120
    : string
121
    {
122
        return $this->wp_oc;
123
    }
124
125
    /**
126
     * Set wpOC
127
     * @param string $arg
128
     */
129
    public function setOCid($arg)
130
    {
131
        $this->wp_oc = $arg;
132
    }
133
134
    public function getDifficulty()
135
    : string
136
    {
137
        return $this->difficulty;
138
    }
139
140
    public function getTerrain()
141
    : string
142
    {
143
        return $this->difficulty;
144
    }
145
146
    public function convertEntityToArray() : array
147
    {
148
        $entityOrigin = [];
149
        $entityArray = [];
150
151
        foreach ($this as $key => $value) {
0 ignored issues
show
Bug introduced by
The expression $this of type this<Oc\Entity\CachesEntity> is not traversable.
Loading history...
152
            $entityOrigin = array_merge($entityOrigin, [$key => $value]);
153
        }
154
155
        $entityArray[0] = $entityOrigin;
156
157
        return $entityArray;
158
    }
159
}
160