public function deleteFromFavorites($options)
 {
     $userId = $options['userId'];
     $request = $options['request'];
     $CI =& get_instance();
     $CI->load->model('request_model');
     $data = array("publication_id" => $request->id, "user_id" => $userId, "request" => $request);
     if (!CI_Offer::checkExistingFavorite($data)) {
         unset($data["request"]);
         return $CI->request_model->deleteFromFavorites($data);
     }
 }
 public function deleteFromFavorites($options)
 {
     $userId = $options['userId'];
     $offer = $options['offer'];
     $CI =& get_instance();
     $CI->load->model('offer_model');
     $data = array("publication_id" => $offer->id, "user_id" => $userId, "offer" => $offer);
     if (!CI_Offer::checkExistingFavorite($data)) {
         unset($data["offer"]);
         return $CI->offer_model->deleteFromFavorites($data);
     }
 }