Skip to content

Commit 931bff8

Browse files
author
Vitaliy Boyko
committed
Fixed Queue generation and form
1 parent 1dbf91a commit 931bff8

File tree

17 files changed

+677
-129
lines changed

17 files changed

+677
-129
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
#if (${NAMESPACE})
4+
5+
namespace ${NAMESPACE};
6+
#end
7+
8+
use Magento\Framework\MessageQueue\ConsumerInterface;
9+
10+
class ${CLASS_NAME} implements ConsumerInterface
11+
{
12+
public function process($maxNumberOfMessages = null)
13+
{
14+
// TODO: Implement process() method.
15+
}
16+
}

resources/fileTemplates/internal/Magento Message Queue Consumer Class.php.html

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
#if (${NAMESPACE})
4+
5+
namespace ${NAMESPACE};
6+
#end
7+
8+
class ${CLASS_NAME}
9+
{
10+
public function execute()
11+
{
12+
//TODO: implement method
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.actions.generation.data;
7+
8+
import com.magento.idea.magento2plugin.magento.files.MessageQueueClassPhp;
9+
10+
@SuppressWarnings({"PMD.DataClass"})
11+
public class MessageQueueClassData {
12+
private final String name;
13+
private final String namespace;
14+
private final String path;
15+
private final String fqn;
16+
private final MessageQueueClassPhp.Type type;
17+
18+
/**
19+
* MessageQueueClassData constructor.
20+
*
21+
* @param name String
22+
* @param namespace String
23+
* @param path String
24+
* @param fqn String
25+
* @param type MessageQueueClassPhp.Type
26+
*/
27+
public MessageQueueClassData(
28+
final String name,
29+
final String namespace,
30+
final String path,
31+
final String fqn,
32+
final MessageQueueClassPhp.Type type
33+
) {
34+
this.name = name;
35+
this.namespace = namespace;
36+
this.path = path;
37+
this.fqn = fqn;
38+
this.type = type;
39+
}
40+
41+
/**
42+
* Get data provider class name.
43+
*
44+
* @return String
45+
*/
46+
public String getName() {
47+
return name;
48+
}
49+
50+
/**
51+
* Get data provider class namespace.
52+
*
53+
* @return String
54+
*/
55+
public String getNamespace() {
56+
return namespace;
57+
}
58+
59+
/**
60+
* Get path.
61+
*
62+
* @return String
63+
*/
64+
public String getPath() {
65+
return path;
66+
}
67+
68+
/**
69+
* Get FQN.
70+
*
71+
* @return String
72+
*/
73+
public String getFqn() {
74+
return fqn;
75+
}
76+
77+
/**
78+
* Get Type.
79+
*
80+
* @return MessageQueueClassPhp.Type
81+
*/
82+
public MessageQueueClassPhp.Type getType() {
83+
return type;
84+
}
85+
}

src/com/magento/idea/magento2plugin/actions/generation/data/QueueConsumerData.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class QueueConsumerData {
1212
private final String maxMessages;
1313
private final String connectionName;
1414
private final String moduleName;
15+
private final String handler;
1516

1617
/**
1718
* Constructor.
@@ -22,14 +23,16 @@ public QueueConsumerData(
2223
final String consumerType,
2324
final String maxMessages,
2425
final String connectionName,
25-
final String moduleName
26+
final String moduleName,
27+
final String handler
2628
) {
2729
this.consumerName = consumerName;
2830
this.queueName = queueName;
2931
this.consumerType = consumerType;
3032
this.maxMessages = maxMessages;
3133
this.connectionName = connectionName;
3234
this.moduleName = moduleName;
35+
this.handler = handler;
3336
}
3437

3538
public String getConsumerName() {
@@ -40,7 +43,7 @@ public String getQueueName() {
4043
return queueName;
4144
}
4245

43-
public String getConsumerType() {
46+
public String getConsumerClass() {
4447
return consumerType;
4548
}
4649

@@ -55,4 +58,8 @@ public String getConnectionName() {
5558
public String getModuleName() {
5659
return moduleName;
5760
}
61+
62+
public String getHandler() {
63+
return handler;
64+
}
5865
}

0 commit comments

Comments
 (0)