ImportableTrait::isImported()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Smart\EtlBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * Nicolas Bastien <[email protected]>
9
 */
10
trait ImportableTrait
11
{
12
    /**
13
     * Store id for remote source, use this as identifiant to make reference in import scripts.
14
     * @var string
15
     *
16
     * @ORM\Column(type="string", length=100, nullable=true, unique=true)
17
     */
18
    protected $importId;
19
20
    /**
21
     * @var \DateTime
22
     * @ORM\Column(type="datetime", nullable=true)
23
     */
24
    protected $importedAt;
25
26
    /**
27
     * @return string
28
     */
29 4
    public function getImportId()
30
    {
31 4
        return $this->importId;
32
    }
33
34
    /**
35
     * @param string $importId
36
     */
37 5
    public function setImportId($importId)
38
    {
39 5
        $this->importId = $importId;
40 5
    }
41
42
    /**
43
     * @return \DateTime
44
     */
45 1
    public function getImportedAt()
46
    {
47 1
        return $this->importedAt;
48
    }
49
50
    /**
51
     * @param \DateTime $importedAt
52
     */
53 1
    public function setImportedAt($importedAt)
54
    {
55 1
        $this->importedAt = $importedAt;
56 1
    }
57
58
    /**
59
     * @return bool
60
     */
61 1
    public function isImported()
62
    {
63 1
        return $this->getImportedAt() !== null;
64
    }
65
}
66