| @@ 2690-2692 (lines=3) @@ | ||
| 2687 | */ | |
| 2688 | 	private function _get_default_where_conditions_for_models_in_query(EE_Model_Query_Info_Carrier $query_info_carrier,$use_default_where_conditions = 'all',$where_query_params = array()){ | |
| 2689 | 		$allowed_used_default_where_conditions_values = array('all','this_model_only', 'other_models_only','none'); | |
| 2690 | 		if( ! in_array($use_default_where_conditions,$allowed_used_default_where_conditions_values)){ | |
| 2691 | 			throw new EE_Error(sprintf(__("You passed an invalid value to the query parameter 'default_where_conditions' of '%s'. Allowed values are %s", "event_espresso"),$use_default_where_conditions,implode(", ",$allowed_used_default_where_conditions_values))); | |
| 2692 | } | |
| 2693 | 		if( in_array($use_default_where_conditions, array('all','this_model_only')) ){ | |
| 2694 | $universal_query_params = $this->_get_default_where_conditions(); | |
| 2695 | 		}else{ | |
| @@ 4380-4391 (lines=12) @@ | ||
| 4377 | */ | |
| 4378 | 	static public function verify_is_valid_cap_context( $context ) { | |
| 4379 | $valid_cap_contexts = EEM_Base::valid_cap_contexts(); | |
| 4380 | 		if( in_array( $context, $valid_cap_contexts ) ) { | |
| 4381 | return true; | |
| 4382 | 		}else{ | |
| 4383 | throw new EE_Error( | |
| 4384 | sprintf( | |
| 4385 | __( 'Context "%1$s" passed into model "%2$s" is not a valid context. They are: %3$s', 'event_espresso' ), | |
| 4386 | $context, | |
| 4387 | 'EEM_Base' , | |
| 4388 | 					implode(',', $valid_cap_contexts ) | |
| 4389 | ) | |
| 4390 | ); | |
| 4391 | } | |
| 4392 | } | |
| 4393 | ||
| 4394 | ||
| @@ 500-510 (lines=11) @@ | ||
| 497 | // don't give up! you gotta... | |
| 498 | 		try { | |
| 499 | //does the file exist and can it be read ? | |
| 500 | 			if ( ! $path ) { | |
| 501 | // so sorry, can't find the file | |
| 502 | throw new EE_Error ( | |
| 503 | sprintf ( | |
| 504 | 						__('The %1$s file %2$s could not be located or is not readable due to file permissions. Please ensure that the following filepath(s) are correct: %3$s','event_espresso'), | |
| 505 | trim( $type, '.' ), | |
| 506 | $class_name, | |
| 507 | '<br />' . implode( ',<br />', $file_paths ) | |
| 508 | ) | |
| 509 | ); | |
| 510 | } | |
| 511 | // get the file | |
| 512 | require_once( $path ); | |
| 513 | // if the class isn't already declared somewhere | |
| @@ 117-119 (lines=3) @@ | ||
| 114 | ||
| 115 | $msgr = $messengers[$messenger]; | |
| 116 | $valid_message_types = $msgr->get_valid_message_types(); | |
| 117 | 		if ( ! in_array( $message_type, $valid_message_types ) ) { | |
| 118 | 			throw new EE_Error( sprint_f( __('The message type ($1%s) sent to $2%s is not valid for the $3%s messenger.  Doublecheck the spelling and verify that message type has been registered as a valid type with the messenger.', 'event_espresso' ), $message_type, __METHOD__, $messenger ) ); | |
| 119 | } | |
| 120 | ||
| 121 | //all is good so let's just get it active | |
| 122 | return $this->activate_messenger( $messenger, array( $message_type ) ); | |