Code Duplication    Length = 7-8 lines in 4 locations

core/db_models/strategies/EE_Soft_Delete_Where_Conditions.strategy.php 1 location

@@ 42-49 (lines=8) @@
39
	 * @return string
40
	 * @throws EE_Error
41
	 */
42
	private function deleted_field_name(){
43
		$field = $this->_model->get_a_field_of_type('EE_Trashed_Flag_Field');
44
		if($field){
45
			return $field->get_name();
46
		}else{
47
			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?','event_espresso'),get_class($this),get_class($this)));
48
		}
49
	}
50
}

core/db_models/EEM_CPT_Base.model.php 1 location

@@ 163-170 (lines=8) @@
160
     * @return string
161
     * @throws EE_Error
162
     */
163
    public function post_status_field_name()
164
    {
165
        $field = $this->get_a_field_of_type('EE_WP_Post_Status_Field');
166
        if ($field) {
167
            return $field->get_name();
168
        } else {
169
            throw new EE_Error(sprintf(__('We are trying to find the post status flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?',
170
                'event_espresso'), get_class($this), get_class($this)));
171
        }
172
    }
173

core/db_models/EEM_Soft_Delete_Base.model.php 1 location

@@ 55-62 (lines=8) @@
52
     * @return string
53
     * @throws EE_Error
54
     */
55
    public function deleted_field_name()
56
    {
57
        $field = $this->get_a_field_of_type('EE_Trashed_Flag_Field');
58
        if ($field) {
59
            return $field->get_name();
60
        } else {
61
            throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?',
62
                'event_espresso'), get_class($this), get_class($this)));
63
        }
64
    }
65

core/db_models/EEM_Base.model.php 1 location

@@ 3466-3472 (lines=7) @@
3463
     * @return string either ASC, asc, DESC or desc
3464
     * @throws EE_Error
3465
     */
3466
    private function _extract_order($should_be_order_string)
3467
    {
3468
        if (in_array($should_be_order_string, $this->_allowed_order_values)) {
3469
            return $should_be_order_string;
3470
        } else {
3471
            throw new EE_Error(sprintf(__("While performing a query on '%s', tried to use '%s' as an order parameter. ",
3472
                "event_espresso"), get_class($this), $should_be_order_string));
3473
        }
3474
    }
3475