diff options
| author | winter | 2024-12-08 23:18:35 +0000 |
|---|---|---|
| committer | winter | 2024-12-08 23:18:35 +0000 |
| commit | bda28640d6e066ae338c6f31407df274ed09f026 (patch) | |
| tree | 2a887dd4f98f79fc11efefc9585c58e144f66a00 /WpfTest/RemoteFetchable.php | |
| parent | b00185ddbac9ac3de975a3954f2ede2f24458f6a (diff) | |
implement remote object fetching!
this is most of the tricky parts of inbound federation :3
Diffstat (limited to 'WpfTest/RemoteFetchable.php')
| -rw-r--r-- | WpfTest/RemoteFetchable.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/WpfTest/RemoteFetchable.php b/WpfTest/RemoteFetchable.php new file mode 100644 index 0000000..0782e7e --- /dev/null +++ b/WpfTest/RemoteFetchable.php @@ -0,0 +1,21 @@ +<?php +namespace WpfTest; + +interface RemoteFetchable { + /** + * Fetches the object by its URI from the remote server. + * @param string $uri the URI of the remote object + * @param bool $autoSave whether to automatically save the fetched object to the database + * @return static + */ + //public static function fetchFromRemote(string $uri, bool $autoSave); + + /** + * Finds the object locally by its URI or fetches it remotely if not found. + * @param string $uri the URI identifier of the object + * @param bool $autoSave whether to automatically save the object (if fetched) to the database + * @param bool $forceRefetch whether to forcibly refetch the object even if it's in the database + * @return static + */ + public static function findByUri(string $uri, bool $autoSave = true, bool $forceRefetch = false); +}
\ No newline at end of file |
