Closed adam-buckley closed 8 years ago
Function returns only both failed and new. You could either add parameter to determine return inclusion for different types, or change function name to "getNewAndFailedMessages".
From the returned array it is tricky to tell if you have a new or failed message. Calling getStatus on a "new" ChannelMessage returns 'NULL'.
$message = $this->getNewOrFailedMessages($channel_id, $processor_id)[0];
$status = $message->getStatus($channel_id)
$status = is_null($status) ? 'new' : ($status->is_successful == 0 ? 'failed' : 'successful');
This function should probably make it easier to tell which is 'new' and which is 'failed'?
Please test reliability over multiple use cases:
To ensure correct data will be returned