eZ\Publish\Core\Repository\TrashService::emptyTrash PHP Method

emptyTrash() public method

All locations contained in the trash will be removed. Content objects will be removed if all locations of the content are gone.
public emptyTrash ( )
    public function emptyTrash()
    {
        if ($this->repository->hasAccess('content', 'cleantrash') !== true) {
            throw new UnauthorizedException('content', 'cleantrash');
        }
        $this->repository->beginTransaction();
        try {
            // Persistence layer takes care of deleting content objects
            $this->persistenceHandler->trashHandler()->emptyTrash();
            $this->repository->commit();
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
    }