summaryrefslogtreecommitdiff
path: root/frontend/Package.php
diff options
context:
space:
mode:
authorCamil Staps2017-02-07 17:49:10 +0100
committerCamil Staps2017-02-07 17:49:10 +0100
commitb46cee71f79795f7300c275f2cfea7fca27a752d (patch)
treeb5cb3efe092ba606ddfd6b90c16f144c219d74c7 /frontend/Package.php
parentDockerise (diff)
Web interface
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]);
+ }
+}