| @@ 132-134 (lines=3) @@ | ||
| 129 | // EEH_Debug_Tools::printr( $fieldValues, '$fieldValues <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 130 | // verify client code has not passed any invalid field names |
|
| 131 | foreach($fieldValues as $field_name=> $field_value){ |
|
| 132 | if( ! isset( $model_fields[ $field_name] ) ){ |
|
| 133 | 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)))); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | // EEH_Debug_Tools::printr( $model_fields, '$model_fields <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
| 137 | $this->_timezone = EEH_DTT_Helper::get_valid_timezone_string( $timezone ); |
|
| @@ 3824-3833 (lines=10) @@ | ||
| 3821 | */ |
|
| 3822 | public function related_settings_for($relation_name){ |
|
| 3823 | $relatedModels=$this->relation_settings(); |
|
| 3824 | if(!array_key_exists($relation_name,$relatedModels)){ |
|
| 3825 | throw new EE_Error( |
|
| 3826 | sprintf( |
|
| 3827 | __('Cannot get %s related to %s. There is no model relation of that type. There is, however, %s...','event_espresso'), |
|
| 3828 | $relation_name, |
|
| 3829 | $this->_get_class_name(), |
|
| 3830 | implode( ', ', array_keys( $relatedModels )) |
|
| 3831 | ) |
|
| 3832 | ); |
|
| 3833 | } |
|
| 3834 | return $relatedModels[$relation_name]; |
|
| 3835 | } |
|
| 3836 | ||
| @@ 4715-4719 (lines=5) @@ | ||
| 4712 | */ |
|
| 4713 | private function _prepare_operator_for_sql($operator_supplied){ |
|
| 4714 | $sql_operator = isset($this->_valid_operators[$operator_supplied]) ? $this->_valid_operators[$operator_supplied] : null; |
|
| 4715 | if($sql_operator){ |
|
| 4716 | return $sql_operator; |
|
| 4717 | }else{ |
|
| 4718 | throw new EE_Error(sprintf(__("The operator '%s' is not in the list of valid operators: %s", "event_espresso"),$operator_supplied,implode(",",array_keys($this->_valid_operators)))); |
|
| 4719 | } |
|
| 4720 | } |
|
| 4721 | ||
| 4722 | ||