function get($lastmodified, $api) { $sync = new Sync(); $output = array(); if ($lastmodified < $sync->get(Sync::USER)) { $output[Sync::USER] = getUser($api); } if ($lastmodified < $sync->get(Sync::SCENARIOS)) { $output[Sync::SCENARIOS] = getScenarios(); } if ($lastmodified < $sync->get(Sync::LIGHTS)) { $output[Sync::LIGHTS] = getLights(); } if ($lastmodified < $sync->get(Sync::ROOMS)) { $output[Sync::ROOMS] = getRooms(); } if ($lastmodified < $sync->get(Sync::PLANTS)) { $output[Sync::PLANTS] = getPlants(); } if ($lastmodified < $sync->get(Sync::DEVICES)) { $output[Sync::DEVICES] = getDevices(); } if ($lastmodified < $sync->get(Sync::SENSORS)) { $output[Sync::SENSORS] = getSensors(); } if ($lastmodified < $sync->get(Sync::EAN)) { $output[Sync::EAN] = getEan(); } return $output; }