src/Titon/Db/Behavior/SoftDeleteBehavior.php
public function purgeDeleted($timeFrame) {
        $config = $this->allConfig();

        return $this->getRepository()->deleteMany(function(Query $query) use ($timeFrame, $config) {
            if ($timeFrame) {
                $query->where($config['deleteField'], '>=', Time::toUnix($timeFrame));

            } else if ($config['useFlag']) {
                $query->where($config['flagField'], true);

            } else {
                $query->where($config['deleteField'], '!=', null);
            }
        }, [
            'before' => false,
            'after' => false
        ]);
    }
public function purgeDeleted($timeFrame) {
        $config = $this->allConfig();

        return $this->getRepository()->deleteMany(function(Query $query) use ($timeFrame, $config) {
            if ($timeFrame) {
                $query->where($config['deleteField'], '>=', Time::toUnix($timeFrame));

            } else if ($config['useFlag']) {
                $query->where($config['flagField'], true);

            } else {
                $query->where($config['deleteField'], '!=', null);
            }
        }, [
            'before' => false,
            'after' => false
        ]);
    }
public function purgeDeleted ( $ timeFrame ) { $ config = $ this -> allConfig ( ) ; return $ this -> getRepository ( ) -> deleteMany ( function ( Query $ query ) use ( $ timeFrame , $ config ) { if ( $ timeFrame ) { $ query -> where ( $ config [ 'deleteField' ] , '>=' , Time :: toUnix ( $ timeFrame ) ) ; } else if ( $ config [ 'useFlag' ] ) { $ query -> where ( $ config [ 'flagField' ] , true ) ; } else { $ query -> where ( $ config [ 'deleteField' ] , '!=' , null ) ; } } , [ 'before' => false , 'after' => false ] ) ; }
Purge all soft deleted records from the database.
If a time frame is provided, delete all records within that time frame.
If no time frame is provided, delete all records based on flag or timestamp being not null.

@uses \Titon\Utility\Time

@param int|string $timeFrame
@return int
Purge all soft deleted records from the database . If a time frame is provided delete all records within that time frame . If no time frame is provided delete all records based on flag or timestamp being not null .