WC_REST_Product_Variations_V2_Controller::get_object
Get object.
Method of the class: WC_REST_Product_Variations_V2_Controller{}
No Hooks.
Returns
WC_Data|null.
Usage
// protected - for code of main (parent) or child class $result = $this->get_object( $id );
- $id(int) (required)
- Object ID.
Changelog
| Since 3.0.0 | Introduced. |
WC_REST_Product_Variations_V2_Controller::get_object() WC REST Product Variations V2 Controller::get object code WC 10.3.6
protected function get_object( $id ) {
$object = wc_get_product( $id );
return ( $object && 0 !== $object->get_parent_id() ) ? $object : null;
}