Skip to content

Commit ecc01f7

Browse files
committed
added segments processor
1 parent a1508f1 commit ecc01f7

11 files changed

+847
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
namespace Lof\Mautic\Queue\Processor\Segments;
4+
5+
use Magento\Framework\Api\SearchCriteriaBuilder;
6+
use Magento\Framework\Api\SortOrderBuilder;
7+
use Magento\Framework\Event\ManagerInterface;
8+
use Magento\Store\Model\StoreManager;
9+
use Magento\Reports\Model\ResourceModel\Quote\CollectionFactory;
10+
use Lof\Mautic\Model\Mautic\Contact;
11+
use Lof\Mautic\Helper\Data;
12+
use Lof\Mautic\Model\Mautic\AbstractApi;
13+
use Lof\Mautic\Queue\MessageQueues\Order\Publisher;
14+
use Lof\Mautic\Queue\Processor\AbstractQueueProcessor;
15+
16+
/**
17+
* Class BestCustomersProcessor
18+
* Find best customers from reports and add to segement name "Best Customers"
19+
*/
20+
class BestCustomersProcessor extends AbstractQueueProcessor
21+
{
22+
/**
23+
* @var array
24+
*/
25+
protected $customergroups = [];
26+
27+
/**
28+
* @var string|null
29+
*/
30+
protected $firstdate = null;
31+
32+
/**
33+
* @var Publisher
34+
*/
35+
private $publisher;
36+
37+
/**
38+
* @var CollectionFactory
39+
*/
40+
protected $collectionFactory;
41+
42+
/**
43+
* @var StoreManager
44+
*/
45+
protected $_storeManager;
46+
47+
48+
/**
49+
* CategoryImport constructor.
50+
*
51+
* @param Contact $mauticContact
52+
* @param Data $helperData
53+
* @param CollectionFactory $collectionFactory
54+
* @param Publisher $publisher
55+
* @param StoreManager $storeManager
56+
*/
57+
public function __construct(
58+
Contact $mauticContact,
59+
Data $helperData,
60+
CollectionFactory $collectionFactory,
61+
Publisher $publisher,
62+
StoreManager $storeManager
63+
) {
64+
parent::__construct($mauticContact, $helperData);
65+
$this->collectionFactory = $collectionFactory;
66+
$this->publisher = $publisher;
67+
$this->_storeManager = $storeManager;
68+
}
69+
70+
/**
71+
* @return void
72+
*/
73+
public function process()
74+
{
75+
//Write code at here
76+
}
77+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
namespace Lof\Mautic\Queue\Processor\Segments;
4+
5+
use Magento\Framework\Api\SearchCriteriaBuilder;
6+
use Magento\Framework\Api\SortOrderBuilder;
7+
use Magento\Framework\Event\ManagerInterface;
8+
use Magento\Store\Model\StoreManager;
9+
use Magento\Reports\Model\ResourceModel\Quote\CollectionFactory;
10+
use Lof\Mautic\Model\Mautic\Contact;
11+
use Lof\Mautic\Helper\Data;
12+
use Lof\Mautic\Model\Mautic\AbstractApi;
13+
use Lof\Mautic\Queue\MessageQueues\Order\Publisher;
14+
use Lof\Mautic\Queue\Processor\AbstractQueueProcessor;
15+
16+
/**
17+
* Class BigSpendersProcessor
18+
* Find best customers from reports and add to segement name "Best Customers"
19+
*/
20+
class BigSpendersProcessor extends AbstractQueueProcessor
21+
{
22+
/**
23+
* @var array
24+
*/
25+
protected $customergroups = [];
26+
27+
/**
28+
* @var string|null
29+
*/
30+
protected $firstdate = null;
31+
32+
/**
33+
* @var Publisher
34+
*/
35+
private $publisher;
36+
37+
/**
38+
* @var CollectionFactory
39+
*/
40+
protected $collectionFactory;
41+
42+
/**
43+
* @var StoreManager
44+
*/
45+
protected $_storeManager;
46+
47+
48+
/**
49+
* CategoryImport constructor.
50+
*
51+
* @param Contact $mauticContact
52+
* @param Data $helperData
53+
* @param CollectionFactory $collectionFactory
54+
* @param Publisher $publisher
55+
* @param StoreManager $storeManager
56+
*/
57+
public function __construct(
58+
Contact $mauticContact,
59+
Data $helperData,
60+
CollectionFactory $collectionFactory,
61+
Publisher $publisher,
62+
StoreManager $storeManager
63+
) {
64+
parent::__construct($mauticContact, $helperData);
65+
$this->collectionFactory = $collectionFactory;
66+
$this->publisher = $publisher;
67+
$this->_storeManager = $storeManager;
68+
}
69+
70+
/**
71+
* @return void
72+
*/
73+
public function process()
74+
{
75+
//Write code at here
76+
}
77+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
namespace Lof\Mautic\Queue\Processor\Segments;
4+
5+
use Magento\Framework\Api\SearchCriteriaBuilder;
6+
use Magento\Framework\Api\SortOrderBuilder;
7+
use Magento\Framework\Event\ManagerInterface;
8+
use Magento\Store\Model\StoreManager;
9+
use Magento\Reports\Model\ResourceModel\Quote\CollectionFactory;
10+
use Lof\Mautic\Model\Mautic\Contact;
11+
use Lof\Mautic\Helper\Data;
12+
use Lof\Mautic\Model\Mautic\AbstractApi;
13+
use Lof\Mautic\Queue\MessageQueues\Order\Publisher;
14+
use Lof\Mautic\Queue\Processor\AbstractQueueProcessor;
15+
16+
/**
17+
* Class LostCheapCustomersProcessor
18+
* Find best customers from reports and add to segement name "Best Customers"
19+
*/
20+
class LostCheapCustomersProcessor extends AbstractQueueProcessor
21+
{
22+
/**
23+
* @var array
24+
*/
25+
protected $customergroups = [];
26+
27+
/**
28+
* @var string|null
29+
*/
30+
protected $firstdate = null;
31+
32+
/**
33+
* @var Publisher
34+
*/
35+
private $publisher;
36+
37+
/**
38+
* @var CollectionFactory
39+
*/
40+
protected $collectionFactory;
41+
42+
/**
43+
* @var StoreManager
44+
*/
45+
protected $_storeManager;
46+
47+
48+
/**
49+
* CategoryImport constructor.
50+
*
51+
* @param Contact $mauticContact
52+
* @param Data $helperData
53+
* @param CollectionFactory $collectionFactory
54+
* @param Publisher $publisher
55+
* @param StoreManager $storeManager
56+
*/
57+
public function __construct(
58+
Contact $mauticContact,
59+
Data $helperData,
60+
CollectionFactory $collectionFactory,
61+
Publisher $publisher,
62+
StoreManager $storeManager
63+
) {
64+
parent::__construct($mauticContact, $helperData);
65+
$this->collectionFactory = $collectionFactory;
66+
$this->publisher = $publisher;
67+
$this->_storeManager = $storeManager;
68+
}
69+
70+
/**
71+
* @return void
72+
*/
73+
public function process()
74+
{
75+
//Write code at here
76+
}
77+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
namespace Lof\Mautic\Queue\Processor\Segments;
4+
5+
use Magento\Framework\Api\SearchCriteriaBuilder;
6+
use Magento\Framework\Api\SortOrderBuilder;
7+
use Magento\Framework\Event\ManagerInterface;
8+
use Magento\Store\Model\StoreManager;
9+
use Magento\Reports\Model\ResourceModel\Quote\CollectionFactory;
10+
use Lof\Mautic\Model\Mautic\Contact;
11+
use Lof\Mautic\Helper\Data;
12+
use Lof\Mautic\Model\Mautic\AbstractApi;
13+
use Lof\Mautic\Queue\MessageQueues\Order\Publisher;
14+
use Lof\Mautic\Queue\Processor\AbstractQueueProcessor;
15+
16+
/**
17+
* Class LostCustomersProcessor
18+
* Find best customers from reports and add to segement name "Best Customers"
19+
*/
20+
class LostCustomersProcessor extends AbstractQueueProcessor
21+
{
22+
/**
23+
* @var array
24+
*/
25+
protected $customergroups = [];
26+
27+
/**
28+
* @var string|null
29+
*/
30+
protected $firstdate = null;
31+
32+
/**
33+
* @var Publisher
34+
*/
35+
private $publisher;
36+
37+
/**
38+
* @var CollectionFactory
39+
*/
40+
protected $collectionFactory;
41+
42+
/**
43+
* @var StoreManager
44+
*/
45+
protected $_storeManager;
46+
47+
48+
/**
49+
* CategoryImport constructor.
50+
*
51+
* @param Contact $mauticContact
52+
* @param Data $helperData
53+
* @param CollectionFactory $collectionFactory
54+
* @param Publisher $publisher
55+
* @param StoreManager $storeManager
56+
*/
57+
public function __construct(
58+
Contact $mauticContact,
59+
Data $helperData,
60+
CollectionFactory $collectionFactory,
61+
Publisher $publisher,
62+
StoreManager $storeManager
63+
) {
64+
parent::__construct($mauticContact, $helperData);
65+
$this->collectionFactory = $collectionFactory;
66+
$this->publisher = $publisher;
67+
$this->_storeManager = $storeManager;
68+
}
69+
70+
/**
71+
* @return void
72+
*/
73+
public function process()
74+
{
75+
//Write code at here
76+
}
77+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
namespace Lof\Mautic\Queue\Processor\Segments;
4+
5+
use Magento\Framework\Api\SearchCriteriaBuilder;
6+
use Magento\Framework\Api\SortOrderBuilder;
7+
use Magento\Framework\Event\ManagerInterface;
8+
use Magento\Store\Model\StoreManager;
9+
use Magento\Reports\Model\ResourceModel\Quote\CollectionFactory;
10+
use Lof\Mautic\Model\Mautic\Contact;
11+
use Lof\Mautic\Helper\Data;
12+
use Lof\Mautic\Model\Mautic\AbstractApi;
13+
use Lof\Mautic\Queue\MessageQueues\Order\Publisher;
14+
use Lof\Mautic\Queue\Processor\AbstractQueueProcessor;
15+
16+
/**
17+
* Class LowSpendersProcessor
18+
* Find best customers from reports and add to segement name "Best Customers"
19+
*/
20+
class LowSpendersProcessor extends AbstractQueueProcessor
21+
{
22+
/**
23+
* @var array
24+
*/
25+
protected $customergroups = [];
26+
27+
/**
28+
* @var string|null
29+
*/
30+
protected $firstdate = null;
31+
32+
/**
33+
* @var Publisher
34+
*/
35+
private $publisher;
36+
37+
/**
38+
* @var CollectionFactory
39+
*/
40+
protected $collectionFactory;
41+
42+
/**
43+
* @var StoreManager
44+
*/
45+
protected $_storeManager;
46+
47+
48+
/**
49+
* CategoryImport constructor.
50+
*
51+
* @param Contact $mauticContact
52+
* @param Data $helperData
53+
* @param CollectionFactory $collectionFactory
54+
* @param Publisher $publisher
55+
* @param StoreManager $storeManager
56+
*/
57+
public function __construct(
58+
Contact $mauticContact,
59+
Data $helperData,
60+
CollectionFactory $collectionFactory,
61+
Publisher $publisher,
62+
StoreManager $storeManager
63+
) {
64+
parent::__construct($mauticContact, $helperData);
65+
$this->collectionFactory = $collectionFactory;
66+
$this->publisher = $publisher;
67+
$this->_storeManager = $storeManager;
68+
}
69+
70+
/**
71+
* @return void
72+
*/
73+
public function process()
74+
{
75+
//Write code at here
76+
}
77+
}

0 commit comments

Comments
 (0)