Automattic\WooCommerce\Internal\StockNotifications
Notification::__construct
Constructor.
Метод класса: Notification{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Notification = new Notification(); $Notification->__construct( $read );
- $read(int|объект|массив)
- ID to load from the DB (optional) or already queried data.
Код Notification::__construct() Notification:: construct WC 11.3.0
public function __construct( $read = 0 ) {
parent::__construct( $read );
if ( is_numeric( $read ) && $read > 0 ) {
$this->set_id( $read );
} elseif ( $read instanceof self ) {
$this->set_id( $read->get_id() );
} elseif ( ! empty( $read->ID ) ) {
$this->set_id( absint( $read->ID ) );
} elseif ( is_array( $read ) && ! empty( $read['id'] ) ) {
$this->set_props( $read );
$this->set_object_read( true );
} else {
$this->set_object_read( true );
}
$this->data_store = \WC_Data_Store::load( 'stock_notification' );
if ( $this->get_id() > 0 ) {
$this->data_store->read( $this );
}
}