forked from queueit/KnownUser.V3.PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.php
More file actions
72 lines (65 loc) · 1.88 KB
/
Models.php
File metadata and controls
72 lines (65 loc) · 1.88 KB
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
<?php
namespace QueueIT\KnownUserV3\SDK;
class Utils
{
public static function isNullOrEmptyString($value){
return (!isset($value) || trim($value)==='');
}
}
class QueueEventConfig
{
public $eventId;
public $layoutName;
public $culture;
public $queueDomain;
public $extendCookieValidity;
public $cookieValidityMinute;
public $cookieDomain;
public $version;
public function getString()
{
return "EventId:".$this->eventId ."&Version:". $this->version
."&QueueDomain:".$this->queueDomain ."&CookieDomain:".$this->cookieDomain. "&ExtendCookieValidity:".$this->extendCookieValidity
."&CookieValidityMinute:" .$this->cookieValidityMinute."&LayoutName:".$this->layoutName."&Culture:".$this->culture;
}
}
class CancelEventConfig
{
public $eventId;
public $queueDomain;
public $cookieDomain;
public $version;
public function getString()
{
return "EventId:".$this->eventId ."&Version:". $this->version
."&QueueDomain:".$this->queueDomain ."&CookieDomain:".$this->cookieDomain;
}
}
class RequestValidationResult
{
public $eventId;
public $redirectUrl;
public $queueId;
public $actionType;
function __construct($actionType ,$eventId, $queueId, $redirectUrl) {
$this->actionType= $actionType;
$this->eventId= $eventId;
$this->queueId= $queueId;
$this->redirectUrl = $redirectUrl;
}
public function doRedirect() {
return !Utils::isNullOrEmptyString($this->redirectUrl);
}
}
class KnownUserException extends \Exception
{
function __construct($message, $code = 0) {
parent::__construct($message, $code);
}
}
class ActionTypes
{
const QueueAction="Queue" ;
const CancelAction="Cancel" ;
const IgnoreAction="Ignore" ;
}