/**
  * Creates a new submission log if logging is enabled
  *
  * @param $data
  *
  * @return bool
  */
 public function addLog($data)
 {
     if ($this->pluginSettings->getAttribute('logSubmissions')) {
         $record = new SpamGuardRecord();
         $record->setAttributes($data, false);
         if ($record->validate()) {
             $record->save();
         }
     }
     return false;
 }
Example #2
0
 /**
  * @param string     $attribute
  * @param bool|false $flattenValue
  * @param array      $default
  *
  * @return array
  */
 public function getAttribute($attribute, $flattenValue = false, $default = [])
 {
     $attribute = parent::getAttribute($attribute, $flattenValue);
     return !is_null($attribute) ? $attribute : $default;
 }