PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / calendars / model.php

model.php in ShiftController Employee Shift Scheduling 4.9.66, at sh4/calendars/model.php

93 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 interface SH4_Calendars_IModel
3 {
4 public function isShift();
5 public function isAvailability();
6 public function isTimeoff();
7 public function getType();
8 }
9
10 class SH4_Calendars_Model implements SH4_Calendars_IModel
11 {
12 const STATUS_ACTIVE = 'publish';
13 const STATUS_ARCHIVE = 'trash';
14
15 const TYPE_SHIFT = 'shift';
16 const TYPE_TIMEOFF = 'timeoff';
17 const TYPE_AVAILABILITY = 'availability';
18
19 private $id = null;
20 private $title = '';
21 private $status = self::STATUS_ACTIVE;
22 private $color = '';
23 private $description = '';
24 private $type = 0;
25 private $sortOrder = 1;
26
27 public function __construct( $id, $title, $status = self::STATUS_ACTIVE, $color = '#cbe86b', $description = '', $type = self::TYPE_TIMEOFF, $sortOrder = 1 )
28 {
29 $this->id = $id;
30 $this->title = $title;
31 $this->color = $color;
32 $this->status = $status;
33 $this->description = $description;
34 $this->type = $type;
35 $this->sortOrder = $sortOrder;
36 }
37
38 public function getId()
39 {
40 return $this->id;
41 }
42
43 public function getTitle()
44 {
45 return $this->title;
46 }
47
48 public function getDescription()
49 {
50 $ret = ( null === $this->description ) ? '' : $this->description;
51 return $ret;
52 }
53
54 public function getColor()
55 {
56 return $this->color;
57 }
58
59 public function getType()
60 {
61 return $this->type;
62 }
63
64 public function isShift()
65 {
66 return ( $this->type == self::TYPE_SHIFT );
67 }
68
69 public function isAvailability()
70 {
71 return ( $this->type == self::TYPE_AVAILABILITY );
72 }
73
74 public function isTimeoff()
75 {
76 return ( $this->type == self::TYPE_TIMEOFF );
77 }
78
79 public function isActive()
80 {
81 return ( $this->status == self::STATUS_ACTIVE );
82 }
83
84 public function isArchived()
85 {
86 return ( $this->status == self::STATUS_ARCHIVE );
87 }
88
89 public function getSortOrder()
90 {
91 return $this->sortOrder;
92 }
93 }