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

DraftableEntityTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isDraft() 0 4 1
A setIsDraft() 0 6 1
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