WordPress at Your Fingertips
function is not described

WC_Order_Item::offsetSet() public WC 1.0

OffsetSet for ArrayAccess.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item = new WC_Order_Item();
$WC_Order_Item->offsetSet( $offset, $value );
$offset(string) (required)
Offset.
$value(mixed) (required)
Value.

Code of WC_Order_Item::offsetSet() WC 5.6.0

public function offsetSet( $offset, $value ) {
	if ( 'item_meta_array' === $offset ) {
		foreach ( $value as $meta_id => $meta ) {
			$this->update_meta_data( $meta->key, $meta->value, $meta_id );
		}
		return;
	}

	if ( array_key_exists( $offset, $this->data ) ) {
		$setter = "set_$offset";
		if ( is_callable( array( $this, $setter ) ) ) {
			$this->$setter( $value );
		}
		return;
	}

	$this->update_meta_data( $offset, $value );
}