WC_Order_Item::offsetExists()publicWC 1.0ReturnTypeWillChange

OffsetExists for ArrayAccess.

Method of the class: WC_Order_Item{}

No Hooks.

Return

true|false.

Usage

$WC_Order_Item = new WC_Order_Item();
$WC_Order_Item->offsetExists( $offset );
$offset(string) (required)
Offset.

WC_Order_Item::offsetExists() code WC 7.3.0

public function offsetExists( $offset ) {
	$this->maybe_read_meta_data();
	if ( 'item_meta_array' === $offset || 'item_meta' === $offset || array_key_exists( $offset, $this->data ) ) {
		return true;
	}
	return array_key_exists( $offset, wp_list_pluck( $this->meta_data, 'value', 'key' ) ) || array_key_exists( '_' . $offset, wp_list_pluck( $this->meta_data, 'value', 'key' ) );
}