Code Duplication    Length = 8-14 lines in 4 locations

core/db_models/EEM_CPT_Base.model.php 1 location

@@ 163-172 (lines=10) @@
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
174
175

core/db_models/EEM_Soft_Delete_Base.model.php 1 location

@@ 55-64 (lines=10) @@
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
66
67

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_Base.model.php 1 location

@@ 3555-3568 (lines=14) @@
3552
     * @return string either ASC, asc, DESC or desc
3553
     * @throws EE_Error
3554
     */
3555
    private function _extract_order($should_be_order_string)
3556
    {
3557
        if (in_array($should_be_order_string, $this->_allowed_order_values)) {
3558
            return $should_be_order_string;
3559
        }
3560
        throw new EE_Error(
3561
            sprintf(
3562
                __(
3563
                    "While performing a query on '%s', tried to use '%s' as an order parameter. ",
3564
                    "event_espresso"
3565
                ), get_class($this), $should_be_order_string
3566
            )
3567
        );
3568
    }
3569
3570
3571