1 | <?php |
||
5 | class Schedule extends Syncable |
||
6 | { |
||
7 | const ONCE = 'once'; |
||
8 | const HOURLY = 'hourly'; |
||
9 | const DAILY = 'daily'; |
||
10 | const WEEKLY = 'weekly'; |
||
11 | |||
12 | /** |
||
13 | * Unique identifier for this schedule |
||
14 | * @var int |
||
15 | */ |
||
16 | protected $id; |
||
17 | |||
18 | /** |
||
19 | * Calendar associated with this schedule |
||
20 | * @var Calendar |
||
21 | */ |
||
22 | protected $calendar; |
||
23 | |||
24 | /** |
||
25 | * Schedule identifier |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $schedule; |
||
29 | |||
30 | public function __construct(Calendar $calendar, $schedule, $id = false) |
||
41 | |||
42 | public function getId() |
||
46 | |||
47 | public function getCalendar() |
||
51 | |||
52 | public function getSchedule() |
||
56 | |||
57 | public function setSchedule($schedule) |
||
61 | |||
62 | public function save() |
||
103 | |||
104 | public function delete() |
||
113 | |||
114 | public static function load($id) |
||
126 | } |
||
127 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: