aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/functions.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/functions.php b/core/functions.php
index 519e5f1..ca13e3d 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -104,6 +104,28 @@ function generateItemTemplateData(Item $Item): array {
}
#===============================================================================
+# Generate pseudo GUID for entity
+#===============================================================================
+function generatePseudoGUID(Item $Entity) {
+ switch(get_class($Entity)) {
+ case "Page\Item":
+ $attr = Application::get('PAGE.FEED_GUID');
+ break;
+ case "Post\Item":
+ $attr = Application::get('POST.FEED_GUID');
+ break;
+ default:
+ $attr = ['id', 'time_insert'];
+ }
+
+ foreach($attr as $attribute) {
+ $attributes[] = $Entity->attr($attribute);
+ }
+
+ return sha1(implode('', $attributes));
+}
+
+#===============================================================================
# Parser for datetime formatted strings [YYYY-MM-DD HH:II:SS]
#===============================================================================
function parseDatetime($datetime, $format): string {