Completed
Push — master ( 1f8449...3785e1 )
by Bernhard
12:25
created

Clipping   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
1
<?php
2
3
/**
4
 * \Wicked\Timely\Entities\Clipping
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Bernhard Wick <[email protected]>
15
 * @copyright 2016 Bernhard Wick
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/wick-ed/timely
18
 */
19
20
namespace Wicked\Timely\Entities;
21
22
/**
23
 * Clipping entity
24
 * A special type of booking which acts as a boundary for tasks which stretch over the time period shown to the user
25
 *
26
 * @author    Bernhard Wick <[email protected]>
27
 * @copyright 2016 Bernhard Wick
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/wick-ed/timely
30
 */
31
class Clipping extends Booking
32
{
33
34
    /**
35
     * Constant for the clipping mark tag
36
     *
37
     * @var string CLIPPING_TAG_FRONT
38
     */
39
    const CLIPPING_TAG_FRONT = '--cf--';
40
41
    /**
42
     * Constant for the clipping mark tag
43
     *
44
     * @var string CLIPPING_TAG_REAR
45
     */
46
    const CLIPPING_TAG_REAR = '--cr--';
47
48
    /**
49
     * Default constructor
50
     *
51
     * @param boolean     $clipFront Whether or not this clipping comes up front or at the end of booking list
52
     * @param null|string $time      Time of this booking
53
     */
54
    public function __construct($clipFront, $time = null)
55
    {
56
        // add the clipping tags as special meta ticket IDs
57
        $this->metaTicketIds[] = self::CLIPPING_TAG_FRONT;
58
        $this->metaTicketIds[] = self::CLIPPING_TAG_REAR;
59
60
        if ($clipFront) {
61
            parent::__construct('', self::CLIPPING_TAG_FRONT, $time);
62
        } else {
63
            parent::__construct('', self::CLIPPING_TAG_REAR, $time);
64
        }
65
    }
66
}
67