| @@ 5587-5593 (lines=7) @@ | ||
| 5584 | */ |
|
| 5585 | public function get_all_copies($model_object_or_attributes_array, $query_params = array()) |
|
| 5586 | { |
|
| 5587 | if ($model_object_or_attributes_array instanceof EE_Base_Class) { |
|
| 5588 | $attributes_array = $model_object_or_attributes_array->model_field_array(); |
|
| 5589 | } elseif (is_array($model_object_or_attributes_array)) { |
|
| 5590 | $attributes_array = $model_object_or_attributes_array; |
|
| 5591 | } else { |
|
| 5592 | throw new EE_Error(sprintf(__("get_all_copies should be provided with either a model object or an array of field-value-pairs, but was given %s", |
|
| 5593 | "event_espresso"), $model_object_or_attributes_array)); |
|
| 5594 | } |
|
| 5595 | //even copies obviously won't have the same ID, so remove the primary key |
|
| 5596 | //from the WHERE conditions for finding copies (if there is a primary key, of course) |
|
| @@ 2868-2874 (lines=7) @@ | ||
| 2865 | */ |
|
| 2866 | public function get_one_conflicting($obj_or_fields_array, $include_primary_key = true) |
|
| 2867 | { |
|
| 2868 | if ($obj_or_fields_array instanceof EE_Base_Class) { |
|
| 2869 | $fields_n_values = $obj_or_fields_array->model_field_array(); |
|
| 2870 | } elseif (is_array($obj_or_fields_array)) { |
|
| 2871 | $fields_n_values = $obj_or_fields_array; |
|
| 2872 | } else { |
|
| 2873 | throw new EE_Error( |
|
| 2874 | sprintf( |
|
| 2875 | __( |
|
| 2876 | "%s get_all_conflicting should be called with a model object or an array of field names and values, you provided %d", |
|
| 2877 | "event_espresso" |
|
| @@ 2061-2073 (lines=13) @@ | ||
| 2058 | if ($otherObject instanceof EE_Base_Class) { |
|
| 2059 | $otherObject->clear_cache($model->get_this_model_name(), $this); |
|
| 2060 | } |
|
| 2061 | } else { |
|
| 2062 | //this thing doesn't exist in the DB, so just cache it |
|
| 2063 | if ( ! $otherObjectModelObjectOrID instanceof EE_Base_Class) { |
|
| 2064 | throw new EE_Error(sprintf( |
|
| 2065 | __('Before a model object is saved to the database, calls to _add_relation_to must be passed an actual object, not just an ID. You provided %s as the model object to a %s', |
|
| 2066 | 'event_espresso'), |
|
| 2067 | $otherObjectModelObjectOrID, |
|
| 2068 | get_class($this) |
|
| 2069 | )); |
|
| 2070 | } else { |
|
| 2071 | $otherObject = $otherObjectModelObjectOrID; |
|
| 2072 | } |
|
| 2073 | $this->cache($relationName, $otherObjectModelObjectOrID, $cache_id); |
|
| 2074 | } |
|
| 2075 | if ($otherObject instanceof EE_Base_Class) { |
|
| 2076 | //fix the reciprocal relation too |
|