コード例 #1
0
 public function rescheduleWithNewOffset($id, $addToOffset)
 {
     ArgCheck::isInt($id);
     ArgCheck::isInt($addToOffset);
     $query = sprintf("UPDATE %s SET offset = offset + %u, next_round_gmt = '%s' WHERE id = %u", self::TABLE_NAME, $addToOffset, Time::now()->addSeconds(2)->asSqlTimestamp(), $id);
     return $this->database->executeQuery($query);
 }
コード例 #2
0
 private function addPlain($email, $ip)
 {
     ArgCheck::isEmail($email);
     ArgCheck::isIp($ip);
     $data = ['email' => $email, 'ip' => $ip, 'created_gmt' => Time::now()->asSqlTimestamp()];
     if ($this->database->insert(self::TABLE_NAME, $data) === false) {
         throw new \RuntimeException('Unable to add subscriber to the database');
     }
 }
コード例 #3
0
 public function setNumberOfEmailsSendPerRequest($value)
 {
     ArgCheck::isInt($value);
     $this->optionBroker->store(self::NUMBER_OF_EMAILS_SEND_PER_REQUEST, $value);
 }
コード例 #4
0
 public function store($option, $value)
 {
     ArgCheck::notNull($option);
     update_option($this->prefix($option), $value);
 }