1 | <?php |
||
7 | class DetectAppointmentsChangingsService |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var AppointmentsCertain |
||
12 | */ |
||
13 | private $appointmentsCertain; |
||
14 | |||
15 | public function __construct(AppointmentsCertain $appointmentsCertain) |
||
19 | |||
20 | /** |
||
21 | * @param $eventCode |
||
22 | * @param null|int $start |
||
23 | * @param null|int $maxResult |
||
24 | * @return mixed |
||
25 | */ |
||
26 | public function getCurrentAppoiments($eventCode,$start=null,$maxResult=null){ |
||
35 | |||
36 | /** |
||
37 | * @param array $appointmentsOld |
||
38 | * @param array $appointmentsNew |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function hasChanged(array $appointmentsOld,array $appointmentsNew){ |
||
53 | |||
54 | /** |
||
55 | * @param $object |
||
56 | * @return array |
||
57 | */ |
||
58 | public static function objectToArray($object) { |
||
65 | |||
66 | /** |
||
67 | * @param $appointments |
||
68 | * @return array |
||
69 | */ |
||
70 | public static function recursiveArrayObjectToFullArray($appointments){ |
||
73 | |||
74 | /** |
||
75 | * @param array $arrayOlds |
||
76 | * @param array $arrayNews |
||
77 | * @return array |
||
78 | */ |
||
79 | private function arrayRecursiveDiff(array $arrayOlds, array $arrayNews) { |
||
88 | |||
89 | /** |
||
90 | * @param array $appointmentsOld |
||
91 | * @param array $appointmentsNew |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getListChangings(array $appointmentsOld,array $appointmentsNew){ |
||
103 | |||
104 | /** |
||
105 | * |
||
106 | * @param array $currentAppointments |
||
107 | * @param array $changingsDetected |
||
108 | * @return array ['deleted'=>[],'updated'=>[]] |
||
109 | */ |
||
110 | public function detectDeleteOrUpdated(array $currentAppointments,array $changingsDetected){ |
||
138 | |||
139 | /** |
||
140 | * @param array $appointmentsOld |
||
141 | * @param array $appointmentsNew |
||
142 | * @return array ['deleted'=>[],'updated'=>[]] |
||
143 | */ |
||
144 | public function detectAppointmentsChangings(array $appointmentsOld,array $appointmentsNew){ |
||
149 | |||
150 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: