Code Duplication    Length = 18-18 lines in 2 locations

core/external/wpeo_model/class/comment.class.php 1 location

@@ 243-260 (lines=18) @@
240
				$data->id = wp_insert_comment( $data->do_wp_object() );
241
242
				$data = Model_Util::exec_callback( $data, $this->after_post_function );
243
			} else {
244
				$data = Model_Util::exec_callback( $data, $this->before_model_put_function );
245
				$current_data = $this->get( array(
246
					'id' => $data['id'],
247
				), true );
248
249
				$obj_merged = (object) array_merge( (array) $current_data, (array) $data );
250
				$data = new $model_name( (array) $obj_merged );
251
				$data = Model_Util::exec_callback( $data, $this->before_put_function );
252
253
				if ( ! empty( $data->error ) && $data->error ) {
254
					return false;
255
				}
256
257
				wp_update_comment( $data->do_wp_object() );
258
259
				$data = Model_Util::exec_callback( $data, $this->after_put_function );
260
			} // End if().
261
262
			Save_Meta_Class::g()->save_meta_data( $data, 'update_comment_meta', $this->meta_key );
263

core/external/wpeo_model/class/user.class.php 1 location

@@ 224-241 (lines=18) @@
221
				$data->id = wp_insert_user( $data->do_wp_object() );
222
223
				$data = Model_Util::exec_callback( $data, $this->after_post_function );
224
			} else {
225
				$data = Model_Util::exec_callback( $data, $this->before_model_put_function );
226
				$current_data = $this->get( array(
227
					'id' => $data['id'],
228
				), true );
229
230
				$obj_merged = (object) array_merge( (array) $current_data, (array) $data );
231
				$data = new $model_name( (array) $obj_merged );
232
				$data = Model_Util::exec_callback( $data, $this->before_put_function );
233
234
				if ( ! empty( $data->error ) && $data->error ) {
235
					return false;
236
				}
237
238
				wp_update_user( $data->do_wp_object() );
239
240
				$data = Model_Util::exec_callback( $data, $this->after_put_function );
241
			}
242
243
			Save_Meta_Class::g()->save_meta_data( $data, 'update_user_meta', $this->meta_key );
244