summaryrefslogtreecommitdiff
path: root/htdocs/src/Post.inc.php
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-06-09 16:56:39 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-06-09 16:56:39 -0700
commit8439ed9ba5b36fa382e32ea883a0877d6ec536c0 (patch)
treecb49279c74804503d42c543e4a2c244695d5ce8a /htdocs/src/Post.inc.php
parent0b1deccfe6cbe7fca0a6abd03abb18cafca59c60 (diff)
Finished added prices. Added more buttons to the headers. Fixed the categories.
Diffstat (limited to 'htdocs/src/Post.inc.php')
-rw-r--r--htdocs/src/Post.inc.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/htdocs/src/Post.inc.php b/htdocs/src/Post.inc.php
index 9747d3f..d887694 100644
--- a/htdocs/src/Post.inc.php
+++ b/htdocs/src/Post.inc.php
@@ -14,6 +14,7 @@ class Post {
private $info;
private $indatabase = false;
private $images;
+ private $category;
public function __construct($info=null) {
@@ -26,7 +27,8 @@ class Post {
$this->indatabase = false;
}
- $images = null;
+ $this->images = null;
+ $this->category = null;
}
public static function getById($id) {
@@ -205,8 +207,17 @@ class Post {
$this->info['email'] = $value;
}
- public function setCategory($value) {
- $this->info['category_id'] = $value;
+ public function setCategory(Category $cat) {
+ $this->info['category_id'] = $cat->getId();
+ $this->category = $cat;
+ }
+
+ public function getCategory() {
+ if ($this->category == NULL) {
+ $this->category = Categories::getById($this->info['category_id']);
+ }
+
+ return $this->category;
}
public function getAge() {
@@ -237,6 +248,14 @@ class Post {
$this->info['location'] = $value;
}
+ public function getPrice() {
+ return $this->info['price'];
+ }
+
+ public function setPrice($value) {
+ $this->info['price'] = $value;
+ }
+
public function getImages() {
if ($this->images == null) {
$this->loadImages();