public function update($args) { $vo = new BlogItemVO(0); $updatedData = array($_POST['title'], $_POST['author'], $_POST['date'], $_POST['categoryID'], $_POST['description'], $_POST['isPrivate'], 'true', $_POST['previewImage'], date('l jS \\of F Y h:i:s A')); for ($i = 0; $i < count($updatedData); $i++) { $updatedData[$i] = rawurldecode($updatedData[$i]); } $this->registry->update->updateData(Types::BLOG_POSTS_TABLE, $args[0], $vo->getTableRowNames(), $updatedData); }
public function parse($data) { $this->databaseData = $data; while ($row = mysql_fetch_array($this->databaseData)) { //echo 'processing...'; $object = new BlogItemVO($row['id']); $object->title(rawurldecode($row['title'])); $object->publishDate(rawurldecode($row['date'])); $object->tags(rawurldecode($row['tags'])); $object->author(rawurldecode($row['author'])); $object->content(rawurldecode($row['content'])); $object->lastEdited(rawurldecode($row['lastEdited'])); $object->previewImageURL(rawurldecode($row['previewImageURL'])); if ($row['isPrivate'] == 'true') { $object->isPrivate(true); } else { if ($row['isPrivate'] == 'false') { $object->isPrivate(false); } else { $object->isPrivate(true); } } if ($row['commentsAllowed'] == 'true') { $object->commentsAllowed(true); } else { if ($row['commentsAllowed'] == 'false') { $object->commentsAllowed(false); } else { $object->commentsAllowed(true); } } array_push($this->parsedData, $object); } return array_reverse($this->parsedData); }