Added FileInterface::touch() method

This commit is contained in:
Matias Griese
2022-02-18 10:14:59 +02:00
parent d96f9f2e11
commit bba877a00a
3 changed files with 20 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
# v1.7.99-feature
## mm/dd/2022
1. [](#new)
* Added `FileInterface::touch()` method
2. [](#improved)
* By default, add media to only pages which have been initialized in pages loop

View File

@@ -341,6 +341,15 @@ class AbstractFile implements FileInterface
return @unlink($this->filepath);
}
/**
* {@inheritdoc}
* @see FileInterface::touch()
*/
public function touch(int $mtime = null): bool
{
return @touch($this->filepath, $mtime);
}
/**
* @param string $dir
* @return bool

View File

@@ -177,4 +177,13 @@ interface FileInterface extends Serializable
* @api
*/
public function delete(): bool;
/**
* Touch file in the filesystem.
*
* @param int|null $mtime
* @return bool Returns `true` if the file was successfully touched, `false` otherwise.
* @api
*/
public function touch(int $mtime = null): bool;
}