WC_Coupon::read_object_from_database()protectedWC 3.4.1

If the object has an ID, read using the data store.

Method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->read_object_from_database();

Changelog

Since 3.4.1 Introduced.

WC_Coupon::read_object_from_database() code WC 8.6.1

protected function read_object_from_database() {
	$this->data_store = WC_Data_Store::load( 'coupon' );

	if ( $this->get_id() > 0 ) {
		$this->data_store->read( $this );
	}
}