Esempio n. 1
0
 public static function getById($id)
 {
     $CI =& get_instance();
     $CI->load->model('offer_type_model');
     $results = $CI->offer_type_model->getById($id);
     $return = array();
     if (!empty($results)) {
         foreach ($results as $result) {
             $return = CI_OfferType::getInstance($result);
         }
     }
     return $return;
 }
Esempio n. 2
0
 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;
 }