| @@ 127-129 (lines=3) @@ | ||
| 124 | // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 125 | // verify client code has not passed any invalid field names |
|
| 126 | foreach($fieldValues as $field_name=> $field_value){ |
|
| 127 | if( ! isset( $model_fields[ $field_name] ) ){ |
|
| 128 | throw new EE_Error(sprintf(__("Invalid field (%s) passed to constructor of %s. Allowed fields are :%s", "event_espresso"),$field_name,get_class($this),implode(", ",array_keys($model_fields)))); |
|
| 129 | } |
|
| 130 | } |
|
| 131 | // EEH_Debug_Tools::printr( $model_fields, '$model_fields <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 132 | $this->_timezone = EEH_DTT_Helper::get_valid_timezone_string( $timezone ); |
|
| @@ 4301-4310 (lines=10) @@ | ||
| 4298 | public function related_settings_for($relation_name) |
|
| 4299 | { |
|
| 4300 | $relatedModels = $this->relation_settings(); |
|
| 4301 | if ( ! array_key_exists($relation_name, $relatedModels)) { |
|
| 4302 | throw new EE_Error( |
|
| 4303 | sprintf( |
|
| 4304 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...', |
|
| 4305 | 'event_espresso'), |
|
| 4306 | $relation_name, |
|
| 4307 | $this->_get_class_name(), |
|
| 4308 | implode(', ', array_keys($relatedModels)) |
|
| 4309 | ) |
|
| 4310 | ); |
|
| 4311 | } |
|
| 4312 | return $relatedModels[$relation_name]; |
|
| 4313 | } |
|
| @@ 5313-5317 (lines=5) @@ | ||
| 5310 | { |
|
| 5311 | $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied] |
|
| 5312 | : null; |
|
| 5313 | if ($sql_operator) { |
|
| 5314 | return $sql_operator; |
|
| 5315 | } else { |
|
| 5316 | throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s", |
|
| 5317 | "event_espresso"), $operator_supplied, implode(",", array_keys($this->_valid_operators)))); |
|
| 5318 | } |
|
| 5319 | } |
|
| 5320 | ||