|
@@ 3918-3931 (lines=14) @@
|
| 3915 |
|
$allow_fields = in_array($query_param_type, array('where', 'having', 'order_by', 'group_by', 'order')); |
| 3916 |
|
//check to see if we have a field on this model |
| 3917 |
|
$this_model_fields = $this->field_settings(true); |
| 3918 |
|
if (array_key_exists($query_param, $this_model_fields)) { |
| 3919 |
|
if ($allow_fields) { |
| 3920 |
|
return; |
| 3921 |
|
} |
| 3922 |
|
throw new EE_Error( |
| 3923 |
|
sprintf( |
| 3924 |
|
__( |
| 3925 |
|
"Using a field name (%s) on model %s is not allowed on this query param type '%s'. Original query param was %s", |
| 3926 |
|
"event_espresso" |
| 3927 |
|
), |
| 3928 |
|
$query_param, get_class($this), $query_param_type, $original_query_param |
| 3929 |
|
) |
| 3930 |
|
); |
| 3931 |
|
} |
| 3932 |
|
//check if this is a special logic query param |
| 3933 |
|
if (in_array($query_param, $this->_logic_query_param_keys, true)) { |
| 3934 |
|
if ($allow_logic_query_params) { |
|
@@ 5109-5112 (lines=4) @@
|
| 5106 |
|
public function add_to_entity_map(EE_Base_Class $object) |
| 5107 |
|
{ |
| 5108 |
|
$className = $this->_get_class_name(); |
| 5109 |
|
if (! $object instanceof $className) { |
| 5110 |
|
throw new EE_Error(sprintf(__("You tried adding a %s to a mapping of %ss", "event_espresso"), |
| 5111 |
|
is_object($object) ? get_class($object) : $object, $className)); |
| 5112 |
|
} |
| 5113 |
|
/** @var $object EE_Base_Class */ |
| 5114 |
|
if (! $object->ID()) { |
| 5115 |
|
throw new EE_Error(sprintf(__("You tried storing a model object with NO ID in the %s entity mapper.", |