RemoteCalls.php in Anti Spam by CleanTalk 9.1.x
File
src/lib/Cleantalk/ApbctDrupal/RemoteCalls.php
View source
<?php
namespace Cleantalk\ApbctDrupal;
class RemoteCalls extends \Cleantalk\Common\RemoteCalls {
public function action__sfw_update() {
return \Drupal\cleantalk\CleantalkFuncs::apbct_sfw_update($this->api_key);
}
public function action__sfw_send_logs() {
return \Drupal\cleantalk\CleantalkFuncs::apbct_sfw_send_logs($this->api_key);
}
public function action__sfw_update__write_base() {
return \Drupal\cleantalk\CleantalkFuncs::apbct_sfw_update($this->api_key);
}
protected function getAvailableRcActions() {
$remote_calls = \Drupal::state()
->get('cleantalk_remote_calls');
if ($remote_calls && !empty($remote_calls)) {
return empty(array_diff_key($remote_calls, $this->default_rc)) ? $remote_calls : $this->default_rc;
}
return $this->default_rc;
}
protected function setLastCall($action) {
$remote_calls = $this
->getAvailableRcActions();
$remote_calls[$action]['last_call'] = time();
\Drupal::state()
->set('cleantalk_remote_calls', $remote_calls);
}
}