@@ -98,6 +98,11 @@ class TokenSubscriber implements EventSubscriberInterface
98
98
*/
99
99
private $ tokenFormatter ;
100
100
101
+ /**
102
+ * @var int
103
+ */
104
+ private $ leadCustomItemFetchLimit ;
105
+
101
106
public function __construct (
102
107
ConfigProvider $ configProvider ,
103
108
QueryFilterHelper $ queryFilterHelper ,
@@ -108,18 +113,20 @@ public function __construct(
108
113
TokenParser $ tokenParser ,
109
114
EventModel $ eventModel ,
110
115
EventDispatcherInterface $ eventDispatcher ,
111
- TokenFormatter $ tokenFormatter
116
+ TokenFormatter $ tokenFormatter ,
117
+ int $ leadCustomItemFetchLimit
112
118
) {
113
- $ this ->configProvider = $ configProvider ;
114
- $ this ->queryFilterHelper = $ queryFilterHelper ;
115
- $ this ->queryFilterFactory = $ queryFilterFactory ;
116
- $ this ->customObjectModel = $ customObjectModel ;
117
- $ this ->customItemModel = $ customItemModel ;
118
- $ this ->customFieldModel = $ customFieldModel ;
119
- $ this ->tokenParser = $ tokenParser ;
120
- $ this ->eventModel = $ eventModel ;
121
- $ this ->eventDispatcher = $ eventDispatcher ;
122
- $ this ->tokenFormatter = $ tokenFormatter ;
119
+ $ this ->configProvider = $ configProvider ;
120
+ $ this ->queryFilterHelper = $ queryFilterHelper ;
121
+ $ this ->queryFilterFactory = $ queryFilterFactory ;
122
+ $ this ->customObjectModel = $ customObjectModel ;
123
+ $ this ->customItemModel = $ customItemModel ;
124
+ $ this ->customFieldModel = $ customFieldModel ;
125
+ $ this ->tokenParser = $ tokenParser ;
126
+ $ this ->eventModel = $ eventModel ;
127
+ $ this ->eventDispatcher = $ eventDispatcher ;
128
+ $ this ->tokenFormatter = $ tokenFormatter ;
129
+ $ this ->leadCustomItemFetchLimit = $ leadCustomItemFetchLimit ;
123
130
}
124
131
125
132
/**
@@ -462,7 +469,7 @@ private function getCustomItems(CustomObject $customObject, string $leadId): arr
462
469
$ orderBy = CustomItem::TABLE_ALIAS .'.id ' ;
463
470
$ orderDir = 'DESC ' ;
464
471
465
- $ tableConfig = new TableConfig (15 , 1 , $ orderBy , $ orderDir );
472
+ $ tableConfig = new TableConfig ($ this -> leadCustomItemFetchLimit , 1 , $ orderBy , $ orderDir );
466
473
$ tableConfig ->addParameter ('customObjectId ' , $ customObject ->getId ());
467
474
$ tableConfig ->addParameter ('filterEntityType ' , 'contact ' );
468
475
$ tableConfig ->addParameter ('filterEntityId ' , $ leadId );
0 commit comments