You are here

public function Firewall::loadFwModule in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Firewall/Firewall.php \Cleantalk\Common\Firewall\Firewall::loadFwModule()

Loads the FireWall module to the array. Factory method for configure instance of FirewallModule. Not returns anything, the result is private storage of the modules.

Parameters

FirewallModule $module:

File

src/lib/Cleantalk/Common/Firewall/Firewall.php, line 141

Class

Firewall

Namespace

Cleantalk\Common\Firewall

Code

public function loadFwModule(FirewallModule $module) {
  if (!in_array($module, $this->fw_modules)) {

    // Configure the Module Obj
    $module
      ->setApiKey($this->api_key);
    $module
      ->setDb($this->db);
    $module
      ->setLogTableName($this->log_table_name);
    $module
      ->setHelper($this->helper);
    $module
      ->setIpArray($this->ip_array);
    $module
      ->setIsDebug($this->debug);
    $module
      ->ipAppendAdditional($this->ip_array);

    // Store the Module Obj
    $this->fw_modules[$module->module_name] = $module;
  }
}