aboutsummaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/ShortUrl.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/models/ShortUrl.php b/lib/models/ShortUrl.php
new file mode 100644
index 0000000..bb72313
--- /dev/null
+++ b/lib/models/ShortUrl.php
@@ -0,0 +1,29 @@
+<?php
+
+
+/**
+ * ShortUrl.php
+ * model class for table short_url
+ *
+ * @property string id The ID of the short URL.
+ * @property string alias
+ * @property string path The URL where the short URL leads to.
+ * @property string user_id The ID of the user who created the short URL.
+ * @property string mkdate The creation timestamp of the short URL.
+ * @property string chdate The modification timestamp of the short URL.
+ * @property User $user belongs_to User
+ */
+class ShortUrl extends SimpleORMap
+{
+ protected static function configure($config = [])
+ {
+ $config['db_table'] = 'short_urls';
+
+ $config['belongs_to']['user'] = [
+ 'class_name' => User::class,
+ 'foreign_key' => 'user_id',
+ ];
+
+ parent::configure($config);
+ }
+}