SimpleSoftwareIO\SMS\Drivers\PlivoSMS::checkMessages PHP Method

checkMessages() public method

Checks the server for messages and returns their results.
public checkMessages ( array $options = [] ) : array
$options array
return array
    public function checkMessages(array $options = [])
    {
        $start = array_key_exists('start', $options) ? $options['start'] : 0;
        $end = array_key_exists('end', $options) ? $options['end'] : 25;
        $rawMessages = $this->plivo->get_messages(['offset' => $start, 'limit' => $end]);
        $incomingMessages = [];
        foreach ($rawMessages['objects'] as $rawMessage) {
            $incomingMessage = $this->createIncomingMessage();
            $this->processReceive($incomingMessage, $rawMessage);
            $incomingMessages[] = $incomingMessage;
        }
        return $incomingMessages;
    }