diff options
author | Robin Appelman <robin@icewind.nl> | 2024-02-08 11:34:22 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-03-04 12:26:30 +0100 |
commit | 4d110c1dd6ae384c00c93b4e266118004b71e498 (patch) | |
tree | f2a27509dd6d9b9094e062d69664568f156cd3a0 /lib/private/Files/Node/LazyFolder.php | |
parent | 2c9761c73ad1ea51f13103819637fbd315806761 (diff) | |
download | nextcloud-server-4d110c1dd6ae384c00c93b4e266118004b71e498.tar.gz nextcloud-server-4d110c1dd6ae384c00c93b4e266118004b71e498.zip |
feat: add interface to get only a single node by id instead of all nodes for the id
this should be enough in most(?) cases and makes efficient implementation and caching easier
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Node/LazyFolder.php')
-rw-r--r-- | lib/private/Files/Node/LazyFolder.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index e30cfea693e..4aae5cf9804 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -492,7 +492,11 @@ class LazyFolder implements Folder { * @inheritDoc */ public function getById($id) { - return $this->__call(__FUNCTION__, func_get_args()); + return $this->getRootFolder()->getByIdInPath((int)$id, $this->getPath()); + } + + public function getFirstNodeById(int $id): ?\OCP\Files\Node { + return $this->getRootFolder()->getFirstNodeByIdInPath($id, $this->getPath()); } /** |