@@ -40,24 +40,24 @@ discard block |
||
| 40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
| 41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
| 42 | 42 | */ |
| 43 | - public function process( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
| 43 | + public function process(\Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
| 44 | 44 | { |
| 45 | 45 | $result = []; |
| 46 | 46 | |
| 47 | - foreach( $order->getProducts() as $item ) |
|
| 47 | + foreach ($order->getProducts() as $item) |
|
| 48 | 48 | { |
| 49 | - if( $subscription->getOrderProductId() != $item->getId() ) { |
|
| 49 | + if ($subscription->getOrderProductId() != $item->getId()) { |
|
| 50 | 50 | continue; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $data = []; |
| 54 | 54 | $list = $item->toArray(); |
| 55 | 55 | |
| 56 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
| 56 | + foreach ($item->getAttributeItems() as $attrItem) |
|
| 57 | 57 | { |
| 58 | - foreach( $attrItem->toArray() as $key => $value ) |
|
| 58 | + foreach ($attrItem->toArray() as $key => $value) |
|
| 59 | 59 | { |
| 60 | - if( isset( $list[$key] ) ) { |
|
| 60 | + if (isset($list[$key])) { |
|
| 61 | 61 | $list[$key] .= "\n" . $value; |
| 62 | 62 | } else { |
| 63 | 63 | $list[$key] = $value; |
@@ -65,16 +65,16 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - foreach( $this->getMapping() as $pos => $key ) |
|
| 68 | + foreach ($this->getMapping() as $pos => $key) |
|
| 69 | 69 | { |
| 70 | - if( array_key_exists( $key, $list ) ) { |
|
| 70 | + if (array_key_exists($key, $list)) { |
|
| 71 | 71 | $data[$pos] = $list[$key]; |
| 72 | 72 | } else { |
| 73 | 73 | $data[$pos] = ''; |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - ksort( $data ); |
|
| 77 | + ksort($data); |
|
| 78 | 78 | $result[] = $data; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -40,20 +40,20 @@ discard block |
||
| 40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
| 41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
| 42 | 42 | */ |
| 43 | - public function process( \Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
| 43 | + public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
| 44 | 44 | { |
| 45 | 45 | $result = []; |
| 46 | 46 | |
| 47 | - foreach( $order->getProducts() as $item ) |
|
| 47 | + foreach ($order->getProducts() as $item) |
|
| 48 | 48 | { |
| 49 | 49 | $data = []; |
| 50 | 50 | $list = $item->toArray(); |
| 51 | 51 | |
| 52 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
| 52 | + foreach ($item->getAttributeItems() as $attrItem) |
|
| 53 | 53 | { |
| 54 | - foreach( $attrItem->toArray() as $key => $value ) |
|
| 54 | + foreach ($attrItem->toArray() as $key => $value) |
|
| 55 | 55 | { |
| 56 | - if( isset( $list[$key] ) ) { |
|
| 56 | + if (isset($list[$key])) { |
|
| 57 | 57 | $list[$key] .= "\n" . $value; |
| 58 | 58 | } else { |
| 59 | 59 | $list[$key] = $value; |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - foreach( $this->getMapping() as $pos => $key ) |
|
| 64 | + foreach ($this->getMapping() as $pos => $key) |
|
| 65 | 65 | { |
| 66 | - if( array_key_exists( $key, $list ) ) { |
|
| 66 | + if (array_key_exists($key, $list)) { |
|
| 67 | 67 | $data[$pos] = $list[$key]; |
| 68 | 68 | } else { |
| 69 | 69 | $data[$pos] = ''; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - ksort( $data ); |
|
| 73 | + ksort($data); |
|
| 74 | 74 | $result[] = $data; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -40,25 +40,25 @@ discard block |
||
| 40 | 40 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Full order with associated items |
| 41 | 41 | * @return array Two dimensional associative list of order data representing the lines in CSV |
| 42 | 42 | */ |
| 43 | - public function process( \Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order ) |
|
| 43 | + public function process(\Aimeos\MShop\Order\Item\Iface $invoice, \Aimeos\MShop\Order\Item\Base\Iface $order) |
|
| 44 | 44 | { |
| 45 | 45 | $result = []; |
| 46 | 46 | $services = $order->getServices(); |
| 47 | 47 | |
| 48 | - krsort( $services ); |
|
| 48 | + krsort($services); |
|
| 49 | 49 | |
| 50 | - foreach( $services as $list ) |
|
| 50 | + foreach ($services as $list) |
|
| 51 | 51 | { |
| 52 | - foreach( $list as $item ) |
|
| 52 | + foreach ($list as $item) |
|
| 53 | 53 | { |
| 54 | 54 | $data = []; |
| 55 | 55 | $list = $item->toArray(); |
| 56 | 56 | |
| 57 | - foreach( $item->getAttributeItems() as $attrItem ) |
|
| 57 | + foreach ($item->getAttributeItems() as $attrItem) |
|
| 58 | 58 | { |
| 59 | - foreach( $attrItem->toArray() as $key => $value ) |
|
| 59 | + foreach ($attrItem->toArray() as $key => $value) |
|
| 60 | 60 | { |
| 61 | - if( isset( $list[$key] ) ) { |
|
| 61 | + if (isset($list[$key])) { |
|
| 62 | 62 | $list[$key] .= "\n" . $value; |
| 63 | 63 | } else { |
| 64 | 64 | $list[$key] = $value; |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - foreach( $this->getMapping() as $pos => $key ) |
|
| 69 | + foreach ($this->getMapping() as $pos => $key) |
|
| 70 | 70 | { |
| 71 | - if( array_key_exists( $key, $list ) ) { |
|
| 71 | + if (array_key_exists($key, $list)) { |
|
| 72 | 72 | $data[$pos] = $list[$key]; |
| 73 | 73 | } else { |
| 74 | 74 | $data[$pos] = ''; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - ksort( $data ); |
|
| 78 | + ksort($data); |
|
| 79 | 79 | $result[] = $data; |
| 80 | 80 | } |
| 81 | 81 | } |