Code Duplication    Length = 11-12 lines in 2 locations

includes/class-wc-order-item.php 2 locations

@@ 190-201 (lines=12) @@
187
	 * Insert data into the database.
188
	 * @since 2.7.0
189
	 */
190
	public function create() {
191
		global $wpdb;
192
193
		$wpdb->insert( $wpdb->prefix . 'woocommerce_order_items', array(
194
			'order_item_name' => $this->get_name(),
195
			'order_item_type' => $this->get_type(),
196
			'order_id'        => $this->get_order_id()
197
		) );
198
		$this->set_id( $wpdb->insert_id );
199
200
		do_action( 'woocommerce_new_order_item', $this->get_id(), $this, $this->get_order_id() );
201
	}
202
203
	/**
204
	 * Update data in the database.
@@ 207-217 (lines=11) @@
204
	 * Update data in the database.
205
	 * @since 2.7.0
206
	 */
207
	public function update() {
208
		global $wpdb;
209
210
		$wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array(
211
			'order_item_name' => $this->get_name(),
212
			'order_item_type' => $this->get_type(),
213
			'order_id'        => $this->get_order_id()
214
		), array( 'order_item_id' => $this->get_id() ) );
215
216
		do_action( 'woocommerce_update_order_item', $this->get_id(), $this, $this->get_order_id() );
217
	}
218
219
	/**
220
	 * Read from the database.