@@ -161,8 +161,7 @@ |
||
161 | 161 | $search->compare( '==', $domain . '.lists.domain', $key ), |
162 | 162 | $search->compare( '==', $domain . '.lists.type', $type ), |
163 | 163 | ] ); |
164 | - } |
|
165 | - else |
|
164 | + } else |
|
166 | 165 | { |
167 | 166 | $type = !strncmp( $type, $domain . '/', $len + 1 ) ? [$type, substr( $type, $len + 1 )] : $type; // remove prefix |
168 | 167 | $list[] = $search->compare( '==', $domain . '.lists.domain', $type ); |
@@ -635,5 +635,5 @@ |
||
635 | 635 | * @see mshop/attribute/manager/newid/ansi |
636 | 636 | * @see mshop/attribute/manager/delete/ansi |
637 | 637 | * @see mshop/attribute/manager/search/ansi |
638 | - */ |
|
638 | + */ |
|
639 | 639 | } |
@@ -612,9 +612,13 @@ |
||
612 | 612 | { |
613 | 613 | if( empty( $item->getInvoiceNumber() ) && $item->getStatusPayment() >= \Aimeos\MShop\Order\Item\Base::PAY_PENDING ) |
614 | 614 | { |
615 | - try { |
|
615 | + try |
|
616 | + { |
|
616 | 617 | $item->setInvoiceNumber( $this->createInvoiceNumber( $item ) ); |
617 | - } catch( \Exception $e ) { // redo on transaction deadlock |
|
618 | + } |
|
619 | + catch( \Exception $e ) |
|
620 | + { |
|
621 | +// redo on transaction deadlock |
|
618 | 622 | $item->setInvoiceNumber( $this->createInvoiceNumber( $item ) ); |
619 | 623 | } |
620 | 624 | } |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function searchRefs( array $entries, array $ref ) : array |
31 | 31 | { |
32 | - $entries = $this->getManager()->searchRefs( $entries, $ref ); |
|
32 | + $entries = $this->getManager()->searchRefs( $entries, $ref ); |
|
33 | 33 | |
34 | 34 | if( $this->hasRef( $ref, 'locale/site' ) && ( $key = $this->getKey( $entries ) ) !== null ) |
35 | 35 | { |
36 | - $siteIds = array_column( $entries, $key ); |
|
37 | - $manager = \Aimeos\MShop::create( $this->context(), 'locale/site' ); |
|
36 | + $siteIds = array_column( $entries, $key ); |
|
37 | + $manager = \Aimeos\MShop::create( $this->context(), 'locale/site' ); |
|
38 | 38 | |
39 | - $filter = $manager->filter( true )->add( ['locale.site.siteid' => $siteIds] )->slice( 0, 0x7fffffff ); |
|
40 | - $siteItems = $manager->search( $filter )->col( null, 'locale.site.siteid' ); |
|
39 | + $filter = $manager->filter( true )->add( ['locale.site.siteid' => $siteIds] )->slice( 0, 0x7fffffff ); |
|
40 | + $siteItems = $manager->search( $filter )->col( null, 'locale.site.siteid' ); |
|
41 | 41 | |
42 | 42 | foreach( $entries as $id => $entry ) { |
43 | 43 | $entries[$id]['.locale/site'] = $siteItems[$entry[$key]] ?? null; |
@@ -48,21 +48,21 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | - /** |
|
52 | - * Returns the key used for the site ID |
|
53 | - * |
|
54 | - * @param array $entries List of associative list of property key/value pairs |
|
55 | - * @return string|null Key used for the site ID or NULL if not found |
|
56 | - */ |
|
57 | - protected function getKey( array $entries ) : ?string |
|
58 | - { |
|
59 | - foreach( current( $entries ) ?: [] as $key => $value ) |
|
60 | - { |
|
61 | - if( !substr_compare( $key, 'siteid', -6 ) ) { |
|
62 | - return $key; |
|
63 | - } |
|
64 | - } |
|
51 | + /** |
|
52 | + * Returns the key used for the site ID |
|
53 | + * |
|
54 | + * @param array $entries List of associative list of property key/value pairs |
|
55 | + * @return string|null Key used for the site ID or NULL if not found |
|
56 | + */ |
|
57 | + protected function getKey( array $entries ) : ?string |
|
58 | + { |
|
59 | + foreach( current( $entries ) ?: [] as $key => $value ) |
|
60 | + { |
|
61 | + if( !substr_compare( $key, 'siteid', -6 ) ) { |
|
62 | + return $key; |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | - return null; |
|
67 | - } |
|
66 | + return null; |
|
67 | + } |
|
68 | 68 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | { |
32 | 32 | $entries = $this->getManager()->searchRefs( $entries, $ref ); |
33 | 33 | |
34 | - if( $this->hasRef( $ref, 'locale/site' ) && ( $key = $this->getKey( $entries ) ) !== null ) |
|
34 | + if( $this->hasRef( $ref, 'locale/site' ) && ( $key = $this->getKey( $entries ) ) !== null ) |
|
35 | 35 | { |
36 | 36 | $siteIds = array_column( $entries, $key ); |
37 | 37 | $manager = \Aimeos\MShop::create( $this->context(), 'locale/site' ); |