| @@ 35-42 (lines=8) @@ | ||
| 32 | * @param string $offset |
|
| 33 | * @return mixed |
|
| 34 | */ |
|
| 35 | public function offsetGet( $offset ) { |
|
| 36 | if ( 'discount_amount' === $offset ) { |
|
| 37 | $offset = 'discount'; |
|
| 38 | } elseif ( 'discount_amount_tax' === $offset ) { |
|
| 39 | $offset = 'discount_tax'; |
|
| 40 | } |
|
| 41 | return parent::offsetGet( $offset ); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * offsetSet for ArrayAccess/Backwards compatibility. |
|
| @@ 50-57 (lines=8) @@ | ||
| 47 | * @param string $offset |
|
| 48 | * @param mixed $value |
|
| 49 | */ |
|
| 50 | public function offsetSet( $offset, $value ) { |
|
| 51 | if ( 'discount_amount' === $offset ) { |
|
| 52 | $offset = 'discount'; |
|
| 53 | } elseif ( 'discount_amount_tax' === $offset ) { |
|
| 54 | $offset = 'discount_tax'; |
|
| 55 | } |
|
| 56 | parent::offsetSet( $offset, $value ); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * offsetExists for ArrayAccess |
|