phpBB API Documentation
Class

phpbb\attachment\delete

class delete

Attachment delete class

Methods

__construct(config $config, driver_interface $db, dispatcher $dispatcher, filesystem $filesystem, resync $resync, string $phpbb_root_path)

Attachment delete class constructor

int|bool delete(string $mode, mixed $ids, bool $resync = true)

Delete Attachments

bool unlink_attachment(string $filename, string $mode = 'file', bool $entry_removed = false)

Delete attachment from filesystem

Details

at line 78
public __construct(config $config, driver_interface $db, dispatcher $dispatcher, filesystem $filesystem, resync $resync, string $phpbb_root_path)

Attachment delete class constructor

Parameters

config $config
driver_interface $db
dispatcher $dispatcher
filesystem $filesystem
resync $resync
string $phpbb_root_path

at line 98
public int|bool delete(string $mode, mixed $ids, bool $resync = true)

Delete Attachments

Parameters

string $mode can be: post|message|topic|attach|user
mixed $ids can be: postids, messageids, topicids, attachids, user_ids
bool $resync set this to false if you are deleting posts or topics

Return Value

int|bool Number of deleted attachments or false if something went wrong during attachment deletion

Delete attachment from filesystem

Parameters

string $filename Filename of attachment
string $mode Delete mode
bool $entry_removed Whether entry was removed. Defaults to false

Return Value

bool True if file was removed, false if not