bedezign\yii2\audit\components\panels\PanelTrait::cleanup PHP Method

cleanup() public method

public cleanup ( integer | null $maxAge = null ) : integer
$maxAge integer | null
return integer
    public function cleanup($maxAge = null)
    {
        $maxAge = $maxAge !== null ? $maxAge : $this->maxAge;
        if ($maxAge === null) {
            return false;
        }
        return AuditData::deleteAll('type = :type AND created <= :created', [':type' => $this->id, ':created' => date('Y-m-d 23:59:59', strtotime("-{$maxAge} days"))]);
    }