Пример #1
0
 public function getMessages($start = 0, $length = -1)
 {
     global $wpdb;
     $start = 0 == intval($start) ? 0 : intval($start);
     $limitClause = Autoresponder::getLimitClauseForRecordSetFetch($start, $length);
     $getMessagesQuery = sprintf('SELECT * FROM %swpr_autoresponder_messages WHERE aid=%d ORDER BY `sequence` %s', $wpdb->prefix, $this->id, $limitClause);
     $messages = $wpdb->get_results($getMessagesQuery);
     $messageObjects = array();
     foreach ($messages as $message) {
         $messageObjects[] = AutoresponderMessage::getMessage(intval($message->id));
     }
     return $messageObjects;
 }