Skip to content

Instantly share code, notes, and snippets.

@dzarezenko
Created November 12, 2009 21:23
Show Gist options
  • Save dzarezenko/233284 to your computer and use it in GitHub Desktop.
Save dzarezenko/233284 to your computer and use it in GitHub Desktop.
<?php
public function addReview($review) {
return $this->insertDBObject($review);
}
public function saveReview($review) {
return $this->updateDBObject($review);
}
public function deleteReview($review) {
return $this->deleteDBObject($review);
}
public function deleteReviewById($reviewId) {
$review = new Review();
$review->setId($reviewId);
return $this->deleteDBObject($review);
}
public function getReview($stmt) {
return $this->selectDBObject($stmt, "Review");
}
public function getReviews($stmt) {
return $this->selectDBObjects($stmt, "Review");
}
public function getReviewById($reviewId) {
$query = "SELECT * FROM reviews WHERE review_id = ?";
$stmt = $this->doSelectQuery($query, "i", array($reviewId));
$review = $this->getReview($stmt);
$stmt->close();
return $review;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment