Exemplo n.º 1
0
 public function setExistingChronicle(Chronicle $chronicle)
 {
     $this->setDefaults(array("id" => $chronicle->getId(), "title" => $chronicle->getTitle(), "keywords" => $chronicle->getKeywords(), "text" => $chronicle->getText(), "link" => $chronicle->getLink(), "link_type" => $chronicle->getLink_type(), "user_id" => $chronicle->getGroup()->getId(), "image" => $chronicle->getImage(), "type" => $chronicle->getType_id(), "user_id" => $chronicle->getUser()->getId(), "group_id" => $chronicle->getGroup()->getId()));
     if ($chronicle->getTag()) {
         $this->setDefault("tag_id", $chronicle->getTag()->getId());
     }
     if ($chronicle->getBook()) {
         $this->setDefault("book_id", $chronicle->getBook()->getId());
     }
 }
Exemplo n.º 2
0
 private function getVideoPressReview(Chronicle $chronicle)
 {
     if ($chronicle->getBook()) {
         $criteria = array("type" => array(false, "=", PressReviewTypes::VIDEO), "book" => array(true, "=", $chronicle->getBook()), "is_validated" => array(false, "=", 1));
         $video = PressReviewSvc::getInstance()->getList($criteria, 1, false);
         if ($video && count($video) == 1) {
             return $video[0];
         }
     }
     return null;
 }
 public function getBook()
 {
     $this->__load();
     return parent::getBook();
 }
Exemplo n.º 4
0
 /**
  * Get a reviews view object representing a paginated list of reviews for the current book
  * @param Chronicle $chronicle the current chronicle to get the book and the reviews from
  * @return \Sb\View\BookReviews NULL BookReviews object or NULL
  */
 private function getReviews(Chronicle $chronicle)
 {
     if ($chronicle->getBook()) {
         // book reviews
         $userBooks = $chronicle->getBook()->getNotDeletedUserBooks();
         $reviewedUserBooks = array_filter($userBooks, array(&$this, "isReviewed"));
         $reviews = "";
         if ($reviewedUserBooks) {
             $paginatedList = new PaginatedList($reviewedUserBooks, 5);
             $reviewsView = new BookReviews($paginatedList, $chronicle->getBook()->getId());
             return $reviewsView;
         }
     }
     return null;
 }