private function get_time_duration_from_form_data(\stdClass $data) {
        if ($data->duration == 1) {
            return $data->timedurationuntil - $data->timestart;
        } else if ($data->duration == 2) {
            return $data->timedurationminutes * MINSECS;
        } else {
            return 0;
        }
    }
private function get_time_duration_from_form_data(\stdClass $data) {
        if ($data->duration == 1) {
            return $data->timedurationuntil - $data->timestart;
        } else if ($data->duration == 2) {
            return $data->timedurationminutes * MINSECS;
        } else {
            return 0;
        }
    }
private function get_time_duration_from_form_data ( \ stdClass $ data ) { if ( $ data -> duration == 1 ) { return $ data -> timedurationuntil - $ data -> timestart ; } else if ( $ data -> duration == 2 ) { return $ data -> timedurationminutes * MINSECS ; } else { return 0 ; } }
A helper function to calculate the time duration for an event based on
the event_form data.

@param \stdClass $data event_form data
@return int
A helper function to calculate the time duration for an event based on the event_form data .