Code Duplication    Length = 3-10 lines in 3 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 4281-4290 (lines=10) @@
4278
    public function related_settings_for($relation_name)
4279
    {
4280
        $relatedModels = $this->relation_settings();
4281
        if ( ! array_key_exists($relation_name, $relatedModels)) {
4282
            throw new EE_Error(
4283
                sprintf(
4284
                    __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...',
4285
                        'event_espresso'),
4286
                    $relation_name,
4287
                    $this->_get_class_name(),
4288
                    implode(', ', array_keys($relatedModels))
4289
                )
4290
            );
4291
        }
4292
        return $relatedModels[$relation_name];
4293
    }
@@ 5293-5297 (lines=5) @@
5290
    {
5291
        $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied]
5292
            : null;
5293
        if ($sql_operator) {
5294
            return $sql_operator;
5295
        } else {
5296
            throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s",
5297
                "event_espresso"), $operator_supplied, implode(",", array_keys($this->_valid_operators))));
5298
        }
5299
    }
5300

core/db_classes/EE_Base_Class.class.php 1 location

@@ 127-129 (lines=3) @@
124
		// EEH_Debug_Tools::printr( $fieldValues, '$fieldValues  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
125
		// verify client code has not passed any invalid field names
126
		foreach($fieldValues as $field_name=> $field_value){
127
			if( ! isset( $model_fields[ $field_name] ) ){
128
				throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s", "event_espresso"),$field_name,get_class($this),implode(", ",array_keys($model_fields))));
129
			}
130
		}
131
		// EEH_Debug_Tools::printr( $model_fields, '$model_fields  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
132
		$this->_timezone = EEH_DTT_Helper::get_valid_timezone_string( $timezone );