コード例 #1
0
ファイル: Offer.php プロジェクト: centaurustech/ayudaresfacil
 public static function getInstance($row)
 {
     if (!$row instanceof stdClass) {
         show_error("El row debe ser una instancia de stdClass.");
     }
     $offer = parent::getInstance($row);
     $offer->processStateOffer = CI_ProcessState::getById($row->process_state_offer);
     $offer->type = CI_OfferType::getById($row->offer_type_id);
     $offer->quantityUsersToPaused = isset($row->quantity_users_to_paused) ? $row->quantity_users_to_paused : '';
     $offer->favorites = CI_Offer::getFavorite($row->publication_id);
     return $offer;
 }
コード例 #2
0
 public static function getInstance($row)
 {
     if (!$row instanceof stdClass) {
         show_error("El row debe ser una instancia de stdClass.");
     }
     $request = parent::getInstance($row);
     $request->votes = CI_Request::getVote($row->publication_id);
     $request->favorites = CI_Request::getFavorite($row->publication_id);
     $request->amountCollected = CI_Request::getAmountCollectedById($row->publication_id);
     $request->quantityDonated = CI_Request::getQuantityDonatedById($row->publication_id);
     $request->sponsors = CI_Sponsor::getByPublicationId($row->publication_id);
     if (isset($row->isVote)) {
         $request->isVote = $row->isVote;
     }
     return $request;
 }