aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/RemoteFetchable.php
diff options
context:
space:
mode:
authorwinter2024-12-09 21:31:54 +0000
committerwinter2024-12-09 21:31:54 +0000
commit4c7bde1400820f36caf8b2a5374007384c3018f3 (patch)
tree83ed26ff368117b8e392f7bc28736482077fc2f4 /Digitigrade/RemoteFetchable.php
parent50edbd3907c26a2d4d616421de9bb51a4d083c1b (diff)
rename to Digitigrade / PawPub
:3
Diffstat (limited to 'Digitigrade/RemoteFetchable.php')
-rw-r--r--Digitigrade/RemoteFetchable.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/Digitigrade/RemoteFetchable.php b/Digitigrade/RemoteFetchable.php
new file mode 100644
index 0000000..4b4262d
--- /dev/null
+++ b/Digitigrade/RemoteFetchable.php
@@ -0,0 +1,21 @@
+<?php
+namespace Digitigrade;
+
+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