Code Duplication    Length = 18-21 lines in 2 locations

core/db_models/EEM_Event.model.php 2 locations

@@ 274-291 (lines=18) @@
271
     * @return array|bool
272
     * @throws \EE_Error
273
     */
274
    public function get_all_event_question_groups($EVT_ID = 0)
275
    {
276
        if (! isset($EVT_ID) || ! absint($EVT_ID)) {
277
            EE_Error::add_error(
278
                esc_html__(
279
                    'An error occurred. No Event Question Groups could be retrieved because an Event ID was not received.',
280
                    'event_espresso'
281
                ),
282
                __FILE__, __FUNCTION__, __LINE__
283
            );
284
            return false;
285
        }
286
        return EE_Registry::instance()->load_model('Event_Question_Group')->get_all(
287
            array(
288
                array('EVT_ID' => $EVT_ID),
289
            )
290
        );
291
    }
292
293
294
@@ 303-323 (lines=21) @@
300
     * @return array|bool
301
     * @throws \EE_Error
302
     */
303
    public function get_event_question_groups($EVT_ID = 0, $for_primary_attendee = true)
304
    {
305
        if (! isset($EVT_ID) || ! absint($EVT_ID)) {
306
            EE_Error::add_error(
307
                esc_html__(
308
                    'An error occurred. No Event Question Groups could be retrieved because an Event ID was not received.',
309
                    'event_espresso'
310
                ),
311
                __FILE__, __FUNCTION__, __LINE__
312
            );
313
            return false;
314
        }
315
        return EE_Registry::instance()->load_model('Event_Question_Group')->get_all(
316
            array(
317
                array(
318
                    'EVT_ID'      => $EVT_ID,
319
                    'EQG_primary' => $for_primary_attendee,
320
                ),
321
            )
322
        );
323
    }
324
325
326