| @@ 166-169 (lines=4) @@ | ||
| 163 | // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 164 | // verify client code has not passed any invalid field names |
|
| 165 | foreach ($fieldValues as $field_name => $field_value) { |
|
| 166 | if ( ! isset($model_fields[$field_name])) { |
|
| 167 | throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s", |
|
| 168 | "event_espresso"), $field_name, get_class($this), implode(", ", array_keys($model_fields)))); |
|
| 169 | } |
|
| 170 | } |
|
| 171 | // EEH_Debug_Tools::printr( $model_fields, '$model_fields <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 172 | $this->_timezone = EEH_DTT_Helper::get_valid_timezone_string($timezone); |
|
| @@ 4784-4794 (lines=11) @@ | ||
| 4781 | public function related_settings_for($relation_name) |
|
| 4782 | { |
|
| 4783 | $relatedModels = $this->relation_settings(); |
|
| 4784 | if (! array_key_exists($relation_name, $relatedModels)) { |
|
| 4785 | throw new EE_Error( |
|
| 4786 | sprintf( |
|
| 4787 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...', |
|
| 4788 | 'event_espresso'), |
|
| 4789 | $relation_name, |
|
| 4790 | $this->_get_class_name(), |
|
| 4791 | implode(', ', array_keys($relatedModels)) |
|
| 4792 | ) |
|
| 4793 | ); |
|
| 4794 | } |
|
| 4795 | return $relatedModels[$relation_name]; |
|
| 4796 | } |
|
| 4797 | ||