Upgrade to 3.7.0
This commit is contained in:
14
kirby/src/Cms/Files.php
Normal file → Executable file
14
kirby/src/Cms/Files.php
Normal file → Executable file
@@ -107,26 +107,30 @@ class Files extends Collection
|
||||
|
||||
/**
|
||||
* Tries to find a file by id/filename
|
||||
* @deprecated 3.7.0 Use `$files->find()` instead
|
||||
* @todo 3.8.0 Remove method
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $id
|
||||
* @return \Kirby\Cms\File|null
|
||||
*/
|
||||
public function findById(string $id)
|
||||
{
|
||||
return $this->get(ltrim($this->parent->id() . '/' . $id, '/'));
|
||||
Helpers::deprecated('Cms\Files::findById() has been deprecated and will be removed in Kirby 3.8.0. Use $files->find() instead.');
|
||||
|
||||
return $this->findByKey($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for FilesFinder::findById() which is
|
||||
* used internally in the Files collection to
|
||||
* map the get method correctly.
|
||||
* Finds a file by its filename
|
||||
* @internal Use `$files->find()` instead
|
||||
*
|
||||
* @param string $key
|
||||
* @return \Kirby\Cms\File|null
|
||||
*/
|
||||
public function findByKey(string $key)
|
||||
{
|
||||
return $this->findById($key);
|
||||
return $this->get(ltrim($this->parent->id() . '/' . $key, '/'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user