| @@ 286-294 (lines=9) @@ | ||
| 283 | * Insert data into the database. |
|
| 284 | * @since 2.6.0 |
|
| 285 | */ |
|
| 286 | public function create() { |
|
| 287 | global $wpdb; |
|
| 288 | $wpdb->insert( $wpdb->prefix . 'woocommerce_order_items', array( |
|
| 289 | 'order_item_name' => $this->get_name(), |
|
| 290 | 'order_item_type' => $this->get_type(), |
|
| 291 | 'order_id' => $this->get_id() |
|
| 292 | ) ); |
|
| 293 | $this->set_item_id( $wpdb->insert_id ); |
|
| 294 | } |
|
| 295 | ||
| 296 | /** |
|
| 297 | * Update data in the database. |
|
| @@ 300-307 (lines=8) @@ | ||
| 297 | * Update data in the database. |
|
| 298 | * @since 2.6.0 |
|
| 299 | */ |
|
| 300 | public function update() { |
|
| 301 | global $wpdb; |
|
| 302 | $wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array( |
|
| 303 | 'order_item_name' => $this->get_name(), |
|
| 304 | 'order_item_type' => $this->get_type(), |
|
| 305 | 'order_id' => $this->get_id() |
|
| 306 | ), array( 'order_item_id' => $this->get_order_item_id() ) ); |
|
| 307 | } |
|
| 308 | ||
| 309 | /** |
|
| 310 | * Read from the database. |
|