File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
app/code/Magento/Newsletter/Model Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \Newsletter \Model ;
9
9
10
10
use Magento \Framework \App \ResourceConnection ;
11
- use Magento \Framework \DB \Adapter \AdapterInterface ;
12
11
13
12
/**
14
13
* Responsible for removing subscriber from queue
15
14
*/
16
15
class RemoveSubscriberFromQueueLink
17
16
{
18
17
/**
19
- * @var AdapterInterface
18
+ * @var ResourceConnection
20
19
*/
21
- private $ connection ;
20
+ private $ resourceConnection ;
22
21
23
22
/**
24
- * @param ResourceConnection $resource
23
+ * @param ResourceConnection $resourceConnection
25
24
*/
26
- public function __construct (ResourceConnection $ resource )
25
+ public function __construct (ResourceConnection $ resourceConnection )
27
26
{
28
- $ this ->connection = $ resource -> getConnection () ;
27
+ $ this ->resourceConnection = $ resourceConnection ;
29
28
}
30
29
31
30
/**
@@ -36,8 +35,10 @@ public function __construct(ResourceConnection $resource)
36
35
*/
37
36
public function execute (int $ subscriberId ): void
38
37
{
39
- $ this ->connection ->delete (
40
- $ this ->connection ->getTableName ('newsletter_queue_link ' ),
38
+ $ connection = $ this ->resourceConnection ->getConnection ();
39
+
40
+ $ connection ->delete (
41
+ $ this ->resourceConnection ->getTableName ('newsletter_queue_link ' ),
41
42
['subscriber_id = ? ' => $ subscriberId , 'letter_sent_at IS NULL ' ]
42
43
);
43
44
}
You can’t perform that action at this time.
0 commit comments