function prepareInputForAdd($input) { if ($input['definition_time'] != 'day') { $input['end_of_working_day'] = 0; } return $input; }