@@ -57,13 +57,19 @@ class Subscription implements SubscriptionInterface
57
57
protected $ linkedViews = [];
58
58
59
59
/**
60
- * List of columns that can be updated in a subscribed table
60
+ * List of columns that can be updated in any subscribed table
61
61
* without creating a new change log entry
62
62
*
63
63
* @var array
64
64
*/
65
65
private $ ignoredUpdateColumns = [];
66
66
67
+ /**
68
+ * List of columns that can be updated in a specific subscribed table
69
+ * for a specific view without creating a new change log entry
70
+ */
71
+ private $ ignoredUpdateColumnsBySubscription = [];
72
+
67
73
/**
68
74
* @var Resource
69
75
*/
@@ -77,6 +83,7 @@ class Subscription implements SubscriptionInterface
77
83
* @param string $tableName
78
84
* @param string $columnName
79
85
* @param array $ignoredUpdateColumns
86
+ * @param array $ignoredUpdateColumnsBySubscription
80
87
*/
81
88
public function __construct (
82
89
ResourceConnection $ resource ,
@@ -85,7 +92,8 @@ public function __construct(
85
92
\Magento \Framework \Mview \ViewInterface $ view ,
86
93
$ tableName ,
87
94
$ columnName ,
88
- $ ignoredUpdateColumns = []
95
+ $ ignoredUpdateColumns = [],
96
+ $ ignoredUpdateColumnsBySubscription = []
89
97
) {
90
98
$ this ->connection = $ resource ->getConnection ();
91
99
$ this ->triggerFactory = $ triggerFactory ;
@@ -95,6 +103,7 @@ public function __construct(
95
103
$ this ->columnName = $ columnName ;
96
104
$ this ->resource = $ resource ;
97
105
$ this ->ignoredUpdateColumns = $ ignoredUpdateColumns ;
106
+ $ this ->ignoredUpdateColumnsBySubscription = $ ignoredUpdateColumnsBySubscription ;
98
107
}
99
108
100
109
/**
@@ -209,7 +218,9 @@ protected function buildStatement($event, $changelog)
209
218
$ describe = $ this ->connection ->describeTable ($ tableName )
210
219
) {
211
220
$ columnNames = array_column ($ describe , 'COLUMN_NAME ' );
212
- $ columnNames = array_diff ($ columnNames , $ this ->ignoredUpdateColumns );
221
+ $ ignoredColumns = array_merge ($ this ->ignoredUpdateColumns ,
222
+ $ this ->ignoredUpdateColumnsBySubscription [$ changelog ->getViewId ()][$ this ->getTableName ()] ?? []);
223
+ $ columnNames = array_diff ($ columnNames , $ ignoredColumns );
213
224
if ($ columnNames ) {
214
225
$ columns = [];
215
226
foreach ($ columnNames as $ columnName ) {
0 commit comments