WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Notes

Note::__construct() public WC 1.0

Note constructor. Loads note data.

{} It's a method of the class: Note{}

No Hooks.

Return

null. Nothing.

Usage

$Note = new Note();
$Note->__construct( $data );
$data(mixed)
Note data, object, or ID.

Code of Note::__construct() WC 5.2.2

<?php
public function __construct( $data = '' ) {
	// Set default data here to allow `content_data` to be an object.
	$this->data = array(
		'name'          => '-',
		'type'          => self::E_WC_ADMIN_NOTE_INFORMATIONAL,
		'locale'        => 'en_US',
		'title'         => '-',
		'content'       => '-',
		'content_data'  => new \stdClass(),
		'status'        => self::E_WC_ADMIN_NOTE_UNACTIONED,
		'source'        => 'woocommerce',
		'date_created'  => '0000-00-00 00:00:00',
		'date_reminder' => '',
		'is_snoozable'  => false,
		'actions'       => array(),
		'layout'        => 'plain',
		'image'         => '',
		'is_deleted'    => false,
	);

	parent::__construct( $data );

	if ( $data instanceof Note ) {
		$this->set_id( absint( $data->get_id() ) );
	} elseif ( is_numeric( $data ) ) {
		$this->set_id( $data );
	} elseif ( is_object( $data ) && ! empty( $data->note_id ) ) {
		$this->set_id( $data->note_id );
		unset( $data->icon ); // Icons are deprecated.
		$this->set_props( (array) $data );
		$this->set_object_read( true );
	} else {
		$this->set_object_read( true );
	}

	$this->data_store = \WC_Data_Store::load( 'admin-note' );
	if ( $this->get_id() > 0 ) {
		$this->data_store->read( $this );
	}
}