Code Duplication    Length = 3-10 lines in 3 locations

core/db_classes/EE_Base_Class.class.php 1 location

@@ 147-149 (lines=3) @@
144
        // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
145
        // verify client code has not passed any invalid field names
146
        foreach ($fieldValues as $field_name => $field_value) {
147
            if ( ! isset($model_fields[$field_name])) {
148
                throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s",
149
                    "event_espresso"), $field_name, get_class($this), implode(", ", array_keys($model_fields))));
150
            }
151
        }
152
        // EEH_Debug_Tools::printr( $model_fields, '$model_fields  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );

core/db_models/EEM_Base.model.php 2 locations

@@ 4595-4604 (lines=10) @@
4592
    public function related_settings_for($relation_name)
4593
    {
4594
        $relatedModels = $this->relation_settings();
4595
        if (! array_key_exists($relation_name, $relatedModels)) {
4596
            throw new EE_Error(
4597
                sprintf(
4598
                    __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...',
4599
                        'event_espresso'),
4600
                    $relation_name,
4601
                    $this->_get_class_name(),
4602
                    implode(', ', array_keys($relatedModels))
4603
                )
4604
            );
4605
        }
4606
        return $relatedModels[$relation_name];
4607
    }
@@ 5608-5612 (lines=5) @@
5605
    {
5606
        $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied]
5607
            : null;
5608
        if ($sql_operator) {
5609
            return $sql_operator;
5610
        } else {
5611
            throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s",
5612
                "event_espresso"), $operator_supplied, implode(",", array_keys($this->_valid_operators))));
5613
        }
5614
    }
5615