| @@ 137-139 (lines=3) @@ | ||
| 134 | // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 135 | // verify client code has not passed any invalid field names |
|
| 136 | foreach ($fieldValues as $field_name => $field_value) { |
|
| 137 | if ( ! isset($model_fields[$field_name])) { |
|
| 138 | throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s", |
|
| 139 | "event_espresso"), $field_name, get_class($this), implode(", ", array_keys($model_fields)))); |
|
| 140 | } |
|
| 141 | } |
|
| 142 | // EEH_Debug_Tools::printr( $model_fields, '$model_fields <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| @@ 4533-4542 (lines=10) @@ | ||
| 4530 | public function related_settings_for($relation_name) |
|
| 4531 | { |
|
| 4532 | $relatedModels = $this->relation_settings(); |
|
| 4533 | if (! array_key_exists($relation_name, $relatedModels)) { |
|
| 4534 | throw new EE_Error( |
|
| 4535 | sprintf( |
|
| 4536 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...', |
|
| 4537 | 'event_espresso'), |
|
| 4538 | $relation_name, |
|
| 4539 | $this->_get_class_name(), |
|
| 4540 | implode(', ', array_keys($relatedModels)) |
|
| 4541 | ) |
|
| 4542 | ); |
|
| 4543 | } |
|
| 4544 | return $relatedModels[$relation_name]; |
|
| 4545 | } |
|
| @@ 5547-5551 (lines=5) @@ | ||
| 5544 | { |
|
| 5545 | $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied] |
|
| 5546 | : null; |
|
| 5547 | if ($sql_operator) { |
|
| 5548 | return $sql_operator; |
|
| 5549 | } else { |
|
| 5550 | throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s", |
|
| 5551 | "event_espresso"), $operator_supplied, implode(",", array_keys($this->_valid_operators)))); |
|
| 5552 | } |
|
| 5553 | } |
|
| 5554 | ||