diff options
author | Camil Staps | 2017-02-07 17:49:10 +0100 |
---|---|---|
committer | Camil Staps | 2017-02-07 17:49:10 +0100 |
commit | b46cee71f79795f7300c275f2cfea7fca27a752d (patch) | |
tree | b5cb3efe092ba606ddfd6b90c16f144c219d74c7 /frontend/Package.php | |
parent | Dockerise (diff) |
Web interface
Diffstat (limited to 'frontend/Package.php')
-rw-r--r-- | frontend/Package.php | 18 |
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]); + } +} |