Code Duplication    Length = 17-19 lines in 2 locations

includes/data-stores/class-wc-product-data-store-cpt.php 1 location

@@ 134-150 (lines=17) @@
131
			true
132
		);
133
134
		if ( $id && ! is_wp_error( $id ) ) {
135
			$product->set_id( $id );
136
137
			$this->update_post_meta( $product, true );
138
			$this->update_terms( $product, true );
139
			$this->update_visibility( $product, true );
140
			$this->update_attributes( $product, true );
141
			$this->update_version_and_type( $product );
142
			$this->handle_updated_props( $product );
143
			$this->clear_caches( $product );
144
145
			$product->save_meta_data();
146
			$product->apply_changes();
147
148
			do_action( 'woocommerce_new_product', $id );
149
		}
150
	}
151
152
	/**
153
	 * Method to read a product from the database.

includes/data-stores/class-wc-product-variation-data-store-cpt.php 1 location

@@ 158-176 (lines=19) @@
155
			true
156
		);
157
158
		if ( $id && ! is_wp_error( $id ) ) {
159
			$product->set_id( $id );
160
161
			$this->update_post_meta( $product, true );
162
			$this->update_terms( $product, true );
163
			$this->update_visibility( $product, true );
164
			$this->update_attributes( $product, true );
165
			$this->handle_updated_props( $product );
166
167
			$product->save_meta_data();
168
			$product->apply_changes();
169
170
			$this->update_version_and_type( $product );
171
			$this->update_guid( $product );
172
173
			$this->clear_caches( $product );
174
175
			do_action( 'woocommerce_new_product_variation', $id );
176
		}
177
	}
178
179
	/**