-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTest.php
112 lines (94 loc) · 2.13 KB
/
Test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* Created by PhpStorm.
* User: Okechukwu
* Date: 5/18/2015
* Time: 9:53 PM
*/
include_once 'vendor/autoload.php';
use CmeKernel\Core\CmeKernel;
$initData = new \CmeData\InitData();
$initData->dbHost = 'localhost';
$initData->dbName = 'cme';
$initData->dbUsername = 'root';
$initData->dbPassword = '';
CmeKernel::init($initData);
function getCampaign()
{
$x = CmeKernel::Campaign()->get(1);
var_dump($x);
}
function pauseCampaign()
{
$c = CmeKernel::Campaign();
$c->pause(3);
}
function copyCampaign()
{
$c = CmeKernel::Campaign();
$c->copy(2);
}
function updateCampaign()
{
$d = new \CmeData\CampaignData();
$d->brandId = 4;
$d->listId = 1;
$d->name = "Test Kernel222";
$d->subject = "Good Test";
$d->htmlContent = "<p>hello</p>";
$d->from = "[email protected]";
$c = CmeKernel::Campaign();
$c->update($d);
}
function createCampaign()
{
$d = new \CmeData\CampaignData();
$d->brandId = 4;
$d->listId = 1;
$d->name = "Test Kernel222";
$d->subject = "Good Test";
$d->htmlContent = "<p>hello</p>";
$d->from = "[email protected]";
CmeKernel::Campaign()->create($d);
}
function getSubscribers()
{
$v = CmeKernel::EmailList()->getSubscribers(12, 0, 10);
var_dump($v);
}
function createList()
{
$l = new \CmeData\ListData();
$l->name = "Kernel List";
$x = CmeKernel::EmailList()->create($l);
echo "List ID: " . $x . PHP_EOL;
}
function addSubscriberToList()
{
$s = new \CmeData\SubscriberData();
$s->email = "[email protected]";
$s->firstName = "Tom";
$s->lastName = "Tom";
$s->age = 30;
$s->id = 300;
CmeKernel::EmailList()->addSubscriber($s, 13);
}
function getSubscriber()
{
$x = CmeKernel::EmailList()->getSubscriber(1, 13);
var_dump($x);
}
function getBrand()
{
$x = CmeKernel::Brand()->get(1);
var_dump($x);
}
function t(\CmeKernel\Enums\EventType $d)
{
$x = new stdClass();
$x->name = $d->getValue();
var_dump($x);
}
$x = new \CmeKernel\Core\CmeAnalytics();
$y = $x->getLastXOfEvent(\CmeKernel\Enums\EventType::QUEUED(), 24, 2);
var_dump($y);