BanModel::save PHP Method

save() public method

Save data about ban from form.
Since: 2.0.18
public save ( array $FormPostValues, array $Settings = false )
$FormPostValues array
$Settings array
    public function save($FormPostValues, $Settings = false)
    {
        $CurrentBanID = val('BanID', $FormPostValues);
        // Get the current ban before saving.
        if ($CurrentBanID) {
            $CurrentBan = $this->getID($CurrentBanID, DATASET_TYPE_ARRAY);
        } else {
            $CurrentBan = null;
        }
        $this->SetCounts($FormPostValues);
        $BanID = parent::Save($FormPostValues, $Settings);
        $FormPostValues['BanID'] = $BanID;
        $this->EventArguments['CurrentBan'] = $CurrentBan;
        $this->EventArguments['FormPostValues'] = $FormPostValues;
        $this->fireEvent('AfterSave');
        $this->ApplyBan($FormPostValues, $CurrentBan);
    }