@@ 142-144 (lines=3) @@ | ||
139 | // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
140 | // verify client code has not passed any invalid field names |
|
141 | foreach ($fieldValues as $field_name => $field_value) { |
|
142 | if ( ! isset($model_fields[$field_name])) { |
|
143 | throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s", |
|
144 | "event_espresso"), $field_name, get_class($this), implode(", ", array_keys($model_fields)))); |
|
145 | } |
|
146 | } |
|
147 | // EEH_Debug_Tools::printr( $model_fields, '$model_fields <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
@@ 4573-4582 (lines=10) @@ | ||
4570 | public function related_settings_for($relation_name) |
|
4571 | { |
|
4572 | $relatedModels = $this->relation_settings(); |
|
4573 | if (! array_key_exists($relation_name, $relatedModels)) { |
|
4574 | throw new EE_Error( |
|
4575 | sprintf( |
|
4576 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...', |
|
4577 | 'event_espresso'), |
|
4578 | $relation_name, |
|
4579 | $this->_get_class_name(), |
|
4580 | implode(', ', array_keys($relatedModels)) |
|
4581 | ) |
|
4582 | ); |
|
4583 | } |
|
4584 | return $relatedModels[$relation_name]; |
|
4585 | } |
|
@@ 5586-5590 (lines=5) @@ | ||
5583 | { |
|
5584 | $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied] |
|
5585 | : null; |
|
5586 | if ($sql_operator) { |
|
5587 | return $sql_operator; |
|
5588 | } else { |
|
5589 | throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s", |
|
5590 | "event_espresso"), $operator_supplied, implode(",", array_keys($this->_valid_operators)))); |
|
5591 | } |
|
5592 | } |
|
5593 |