@@ 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' ); |
@@ 4674-4683 (lines=10) @@ | ||
4671 | public function related_settings_for($relation_name) |
|
4672 | { |
|
4673 | $relatedModels = $this->relation_settings(); |
|
4674 | if (! array_key_exists($relation_name, $relatedModels)) { |
|
4675 | throw new EE_Error( |
|
4676 | sprintf( |
|
4677 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...', |
|
4678 | 'event_espresso'), |
|
4679 | $relation_name, |
|
4680 | $this->_get_class_name(), |
|
4681 | implode(', ', array_keys($relatedModels)) |
|
4682 | ) |
|
4683 | ); |
|
4684 | } |
|
4685 | return $relatedModels[$relation_name]; |
|
4686 | } |