Code Duplication    Length = 15-15 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 1214-1228 (lines=15) @@
1211
     * @return EE_Base_Class|EE_Soft_Delete_Base_Class|NULL
1212
     * @throws EE_Error
1213
     */
1214
    public function get_one($query_params = array())
1215
    {
1216
        if (! is_array($query_params)) {
1217
            EE_Error::doing_it_wrong('EEM_Base::get_one',
1218
                sprintf(__('$query_params should be an array, you passed a variable of type %s', 'event_espresso'),
1219
                    gettype($query_params)), '4.6.0');
1220
            $query_params = array();
1221
        }
1222
        $query_params['limit'] = 1;
1223
        $items = $this->get_all($query_params);
1224
        if (empty($items)) {
1225
            return null;
1226
        }
1227
        return array_shift($items);
1228
    }
1229
1230
1231
@@ 5616-5630 (lines=15) @@
5613
     * @return EE_Base_Class
5614
     * @throws EE_Error
5615
     */
5616
    public function get_one_copy($model_object_or_attributes_array, $query_params = array())
5617
    {
5618
        if (! is_array($query_params)) {
5619
            EE_Error::doing_it_wrong('EEM_Base::get_one_copy',
5620
                sprintf(__('$query_params should be an array, you passed a variable of type %s', 'event_espresso'),
5621
                    gettype($query_params)), '4.6.0');
5622
            $query_params = array();
5623
        }
5624
        $query_params['limit'] = 1;
5625
        $copies = $this->get_all_copies($model_object_or_attributes_array, $query_params);
5626
        if (is_array($copies)) {
5627
            return array_shift($copies);
5628
        }
5629
        return null;
5630
    }
5631
5632
5633