| @@ 40-49 (lines=10) @@ | ||
| 37 | * @param string $offset |
|
| 38 | * @return mixed |
|
| 39 | */ |
|
| 40 | public function offsetGet( $offset ) { |
|
| 41 | if ( 'line_total' === $offset ) { |
|
| 42 | $offset = 'total'; |
|
| 43 | } elseif ( 'line_tax' === $offset ) { |
|
| 44 | $offset = 'total_tax'; |
|
| 45 | } elseif ( 'line_tax_data' === $offset ) { |
|
| 46 | $offset = 'taxes'; |
|
| 47 | } |
|
| 48 | return parent::offsetGet( $offset ); |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * offsetSet for ArrayAccess/Backwards compatibility. |
|
| @@ 57-66 (lines=10) @@ | ||
| 54 | * @param string $offset |
|
| 55 | * @param mixed $value |
|
| 56 | */ |
|
| 57 | public function offsetSet( $offset, $value ) { |
|
| 58 | if ( 'line_total' === $offset ) { |
|
| 59 | $offset = 'total'; |
|
| 60 | } elseif ( 'line_tax' === $offset ) { |
|
| 61 | $offset = 'total_tax'; |
|
| 62 | } elseif ( 'line_tax_data' === $offset ) { |
|
| 63 | $offset = 'taxes'; |
|
| 64 | } |
|
| 65 | parent::offsetSet( $offset, $value ); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * offsetExists for ArrayAccess |
|