Completed
Push — develop ( 168e99...0122be )
by
unknown
18:37 queued 07:11
created

DraftableEntityTrait::isDraft()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 */
9
10
/** Core models */
11
namespace Core\Entity;
12
13
/**
14
 * Trait implementing DraftableEntityInterface
15
 *
16
 * @author Mathias Gelhausen <[email protected]>
17
 */
18
trait DraftableEntityTrait
19
{
20
    /**
21
     * The current draft state of this entity.
22
     *
23
     * @ODM\Boolean
24
     * @var bool
25
     */
26
    protected $isDraft = true;
27
28
    public function isDraft()
29
    {
30
        return $this->isDraft;
31
    }
32
    
33
    public function setIsDraft($flag)
34
    {
35
        $this->isDraft = (bool) $flag;
36
37
        return $this;
38
    }
39
}
40