@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/product/bought/name |
36 | 36 | * Class name of the used product suggestions scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.03 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/product/bought/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/product/bought/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Product\\Bought\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Product\\Bought\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Product\\Bought\\' . $name; |
80 | 80 | |
81 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/product/bought/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the product bought job controller |
@@ -155,6 +155,6 @@ discard block |
||
155 | 155 | * @see controller/jobs/product/bought/decorators/excludes |
156 | 156 | * @see controller/jobs/product/bought/decorators/global |
157 | 157 | */ |
158 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'product/bought' ); |
|
158 | + return self::addControllerDecorators($context, $aimeos, $controller, 'product/bought'); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/export/csv/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/export/csv/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Export\\Csv\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Export\\Csv\\' . $name; |
79 | 79 | |
80 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/export/csv/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription export CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/export/csv/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/export/csv/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/export/csv' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/export/csv'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/end/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/end/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\End\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\End\\' . $name; |
79 | 79 | |
80 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/end/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/end/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/end/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/end' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/end'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/renew/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/renew/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\' . $name; |
79 | 79 | |
80 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/renew/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/renew/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/renew/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/renew' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/renew'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/subscription/process/begin/name |
35 | 35 | * Class name of the used subscription suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/subscription/process/begin/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Begin\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Begin\\' . $name; |
79 | 79 | |
80 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/subscription/process/begin/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the subscription process CSV job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/subscription/process/begin/decorators/excludes |
155 | 155 | * @see controller/jobs/subscription/process/begin/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'subscription/process/begin' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'subscription/process/begin'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/order/cleanup/unfinished/name |
36 | 36 | * Class name of the used order cleanup unfinished scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.03 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/order/cleanup/unfinished/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name; |
80 | 80 | |
81 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/order/cleanup/unfinished/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the order cleanup unfinished controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/order/cleanup/unfinished/decorators/excludes |
155 | 155 | * @see controller/jobs/order/cleanup/unfinished/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unfinished' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unfinished'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes unfinished orders' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes unfinished orders'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getDescription() |
42 | 42 | { |
43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Deletes unfinished orders an makes their products and coupon codes available again' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Deletes unfinished orders an makes their products and coupon codes available again'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | public function run() |
53 | 53 | { |
54 | 54 | $context = $this->getContext(); |
55 | - $controller = \Aimeos\Controller\Common\Order\Factory::create( $context ); |
|
56 | - $baseManager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
57 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
55 | + $controller = \Aimeos\Controller\Common\Order\Factory::create($context); |
|
56 | + $baseManager = \Aimeos\MShop::create($context, 'order/base'); |
|
57 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
58 | 58 | |
59 | 59 | /** controller/jobs/order/cleanup/unfinished/keep-hours |
60 | 60 | * Release the ordered products after the configured time if no payment was confirmed |
@@ -74,35 +74,35 @@ discard block |
||
74 | 74 | * @since 2014.07 |
75 | 75 | * @category User |
76 | 76 | */ |
77 | - $hours = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/keep-hours', 24 ); |
|
78 | - $limit = date( 'Y-m-d H:i:s', time() - 3600 * $hours ); |
|
77 | + $hours = $context->getConfig()->get('controller/jobs/order/cleanup/unfinished/keep-hours', 24); |
|
78 | + $limit = date('Y-m-d H:i:s', time() - 3600 * $hours); |
|
79 | 79 | |
80 | 80 | $search = $manager->createSearch(); |
81 | 81 | $expr = array( |
82 | - $search->compare( '<', 'order.mtime', $limit ), |
|
83 | - $search->compare( '==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED ), |
|
82 | + $search->compare('<', 'order.mtime', $limit), |
|
83 | + $search->compare('==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED), |
|
84 | 84 | ); |
85 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
85 | + $search->setConditions($search->combine('&&', $expr)); |
|
86 | 86 | |
87 | 87 | $start = 0; |
88 | 88 | |
89 | 89 | do |
90 | 90 | { |
91 | 91 | $baseIds = []; |
92 | - $items = $manager->searchItems( $search ); |
|
92 | + $items = $manager->searchItems($search); |
|
93 | 93 | |
94 | - foreach( $items as $item ) |
|
94 | + foreach ($items as $item) |
|
95 | 95 | { |
96 | - $controller->unblock( $item ); |
|
96 | + $controller->unblock($item); |
|
97 | 97 | $baseIds[] = $item->getBaseId(); |
98 | 98 | } |
99 | 99 | |
100 | - $baseManager->deleteItems( $baseIds ); |
|
100 | + $baseManager->deleteItems($baseIds); |
|
101 | 101 | |
102 | - $count = count( $items ); |
|
102 | + $count = count($items); |
|
103 | 103 | $start += $count; |
104 | - $search->setSlice( $start ); |
|
104 | + $search->setSlice($start); |
|
105 | 105 | } |
106 | - while( $count >= $search->getSliceSize() ); |
|
106 | + while ($count >= $search->getSliceSize()); |
|
107 | 107 | } |
108 | 108 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/order/cleanup/unpaid/name |
36 | 36 | * Class name of the used order cleanup unpaid scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.07 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name; |
80 | 80 | |
81 | - $controller = self::createController( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createController($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/order/cleanup/unpaid/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the order cleanup unpaid controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/order/cleanup/unpaid/decorators/excludes |
155 | 155 | * @see controller/jobs/order/cleanup/unpaid/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unpaid' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unpaid'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes unpaid orders' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes unpaid orders'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getDescription() |
42 | 42 | { |
43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Deletes unpaid orders to keep the database clean' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Deletes unpaid orders to keep the database clean'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | public function run() |
53 | 53 | { |
54 | 54 | $context = $this->getContext(); |
55 | - $controller = \Aimeos\Controller\Common\Order\Factory::create( $context ); |
|
56 | - $baseManager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
57 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
55 | + $controller = \Aimeos\Controller\Common\Order\Factory::create($context); |
|
56 | + $baseManager = \Aimeos\MShop::create($context, 'order/base'); |
|
57 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
58 | 58 | |
59 | 59 | /** controller/jobs/order/cleanup/unpaid/keep-days |
60 | 60 | * Removes all orders from the database that are unpaid |
@@ -71,35 +71,35 @@ discard block |
||
71 | 71 | * @since 2014.07 |
72 | 72 | * @category User |
73 | 73 | */ |
74 | - $days = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/keep-days', 3 ); |
|
75 | - $limit = date( 'Y-m-d H:i:s', time() - 86400 * $days ); |
|
74 | + $days = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/keep-days', 3); |
|
75 | + $limit = date('Y-m-d H:i:s', time() - 86400 * $days); |
|
76 | 76 | |
77 | 77 | $search = $manager->createSearch(); |
78 | 78 | $expr = array( |
79 | - $search->compare( '<', 'order.mtime', $limit ), |
|
80 | - $search->compare( '<', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_REFUND ), |
|
79 | + $search->compare('<', 'order.mtime', $limit), |
|
80 | + $search->compare('<', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_REFUND), |
|
81 | 81 | ); |
82 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
82 | + $search->setConditions($search->combine('&&', $expr)); |
|
83 | 83 | |
84 | 84 | $start = 0; |
85 | 85 | |
86 | 86 | do |
87 | 87 | { |
88 | 88 | $baseIds = []; |
89 | - $items = $manager->searchItems( $search ); |
|
89 | + $items = $manager->searchItems($search); |
|
90 | 90 | |
91 | - foreach( $items as $item ) |
|
91 | + foreach ($items as $item) |
|
92 | 92 | { |
93 | - $controller->unblock( $item ); |
|
93 | + $controller->unblock($item); |
|
94 | 94 | $baseIds[] = $item->getBaseId(); |
95 | 95 | } |
96 | 96 | |
97 | - $baseManager->deleteItems( $baseIds ); |
|
97 | + $baseManager->deleteItems($baseIds); |
|
98 | 98 | |
99 | - $count = count( $items ); |
|
99 | + $count = count($items); |
|
100 | 100 | $start += $count; |
101 | - $search->setSlice( $start ); |
|
101 | + $search->setSlice($start); |
|
102 | 102 | } |
103 | - while( $count >= $search->getSliceSize() ); |
|
103 | + while ($count >= $search->getSliceSize()); |
|
104 | 104 | } |
105 | 105 | } |