summaryrefslogtreecommitdiff
path: root/frontend/Package.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/Package.php')
-rw-r--r--frontend/Package.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/Package.php b/frontend/Package.php
new file mode 100644
index 0000000..0b2afed
--- /dev/null
+++ b/frontend/Package.php
@@ -0,0 +1,18 @@
+<?php
+class Package extends Model {
+ public static
+ $table = 'package',
+ $fillable_columns = ['author_id', 'name', 'url', 'git_url', 'desc'];
+
+ public function getAuthor() {
+ return new Author($this->pdo, $this->author_id);
+ }
+
+ public function getVersionIds() {
+ return Version::searchIds($this->pdo, ['`package_id`=?'], [$this->id]);
+ }
+
+ public function getVersions() {
+ return Version::search($this->pdo, ['`package_id`=?'], [$this->id]);
+ }
+}