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); }
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'); } }
public function setNumberOfEmailsSendPerRequest($value) { ArgCheck::isInt($value); $this->optionBroker->store(self::NUMBER_OF_EMAILS_SEND_PER_REQUEST, $value); }
public function store($option, $value) { ArgCheck::notNull($option); update_option($this->prefix($option), $value); }