Sender
Class Sender
Table of Contents
Constants
- RESULT_CONTINUE = 2
- RESULT_ERROR = 3
- RESULT_NONE = 0
- RESULT_SENT = 1
- RESULT_WAIT = 4
- RESULT_WAITING_RECIPIENT = 5
Methods
- __construct() : mixed
- Sender constructor.
- applyRecipientToMessage() : void
- Apply recipient data to message.
- getExceededLimiter() : iLimiter|null
- Get transport exceeded limiter.
- getMessage() : Adapter
- getResultCode() : int
- Get result code.
- getThreadStrategy() : IThreadStrategy
- isLimitExceeded() : bool
- Check limits.
- isTimeout() : bool
- Check timeout.
- isTransportLimitsExceeded() : bool
- Check transport limits.
- load() : void
- Load posting.
- lock() : bool
- Lock posting for preventing double sending
- send() : void
- Send.
- setLimit() : $this
- Set limit.
- setThreadStrategy() : Sender
- setTimeout() : $this
- Set timeout.
- startTime() : void
- Start time watch.
- unlock() : bool
- UnLock posting that was locking for preventing double sending
- updateActualStatus() : string
- Update actual status.
Constants
RESULT_CONTINUE
public
mixed
RESULT_CONTINUE
= 2
RESULT_ERROR
public
mixed
RESULT_ERROR
= 3
RESULT_NONE
public
mixed
RESULT_NONE
= 0
RESULT_SENT
public
mixed
RESULT_SENT
= 1
RESULT_WAIT
public
mixed
RESULT_WAIT
= 4
RESULT_WAITING_RECIPIENT
public
mixed
RESULT_WAITING_RECIPIENT
= 5
Methods
__construct()
Sender constructor.
public
__construct(Letter $letter) : mixed
Parameters
- $letter : Letter
-
Letter.
applyRecipientToMessage()
Apply recipient data to message.
public
static applyRecipientToMessage(Adapter $message, array<string|int, mixed> $recipient[, bool $isTest = false ]) : void
Parameters
- $message : Adapter
-
Message.
- $recipient : array<string|int, mixed>
-
Recipient.
- $isTest : bool = false
-
Is test.
getExceededLimiter()
Get transport exceeded limiter.
public
getExceededLimiter() : iLimiter|null
Return values
iLimiter|nullgetMessage()
public
getMessage() : Adapter
Return values
AdaptergetResultCode()
Get result code.
public
getResultCode() : int
Return values
intgetThreadStrategy()
public
getThreadStrategy() : IThreadStrategy
Return values
IThreadStrategyisLimitExceeded()
Check limits.
public
isLimitExceeded() : bool
Return values
boolisTimeout()
Check timeout.
public
isTimeout() : bool
Return values
boolisTransportLimitsExceeded()
Check transport limits.
public
isTransportLimitsExceeded() : bool
Return values
boolload()
Load posting.
public
load(int $postingId) : void
Parameters
- $postingId : int
-
Posting ID.
lock()
Lock posting for preventing double sending
public
static lock(int $id[, int $threadId = 0 ]) : bool
Parameters
- $id : int
-
ID
- $threadId : int = 0
-
Default 0
Return values
boolsend()
Send.
public
send() : void
Tags
setLimit()
Set limit.
public
setLimit(int $limit) : $this
Parameters
- $limit : int
-
Limit.
Return values
$thissetThreadStrategy()
public
setThreadStrategy(IThreadStrategy $threadStrategy) : Sender
Parameters
- $threadStrategy : IThreadStrategy
Return values
SendersetTimeout()
Set timeout.
public
setTimeout(int $timeout) : $this
Parameters
- $timeout : int
-
Timeout.
Return values
$thisstartTime()
Start time watch.
public
startTime() : void
unlock()
UnLock posting that was locking for preventing double sending
public
static unlock(int $id[, int $threadId = 0 ]) : bool
Parameters
- $id : int
-
ID
- $threadId : int = 0
Return values
boolupdateActualStatus()
Update actual status.
public
static updateActualStatus(int $postingId[, bool $isPrevented = false ][, mixed $awaitThread = false ]) : string
Parameters
- $postingId : int
-
Posting ID.
- $isPrevented : bool = false
-
Is sending prevented.
- $awaitThread : mixed = false