Example #1
0
 /**
  * @overrides delete from RestResource
  */
 public function delete()
 {
     if (parent::delete() !== false) {
         $bms = new Default_Model_MailSubscriptions();
         $appid = $this->getParam("appid");
         $bms->filter->flt->equals("=application.id:{$appid} application.id:SYSTAG_FOLLOW")->and($bms->filter->researcherid->equals($this->getParam("id")));
         if (count($bms->items) > 0) {
             $bm = $bms->items[0];
             $bms->remove($bm);
             $res = new RestAppItem(array("id" => $appid), $this);
             return $res->get();
         } else {
             $this->setError(RestErrorEnum::RE_ITEM_NOT_FOUND);
             return false;
         }
     } else {
         return false;
     }
 }