Exemple #1
0
 /**
  * @overrides get() from RestResource
  */
 public function get()
 {
     if (parent::get() !== false) {
         $res = new Default_Model_Dissemination();
         if (is_null($this->getParam("orderby"))) {
             $res->filter->orderBy("senton DESC");
         } else {
             $res->filter->orderBy($this->getParam("orderby"));
         }
         $res->filter->id->equals($this->getParam("id"));
         $res->refresh("xml");
         return new XMLFragmentRestResponse($res->items);
     } else {
         return false;
     }
 }
Exemple #2
0
 /**
  * @overrides delete() from RestResource
  */
 public function delete()
 {
     if (parent::delete() !== false) {
         $apps = new Default_Model_Applications();
         $apps->filter->deleted->equals(false)->and($apps->filter->owner->equals($this->_res->id));
         if (count($apps->items) > 0) {
             $this->setError(RestErrorEnum::RE_BACKEND_ERROR, "Cannot delete profile that owns application entries", false);
             return false;
         } else {
             $ret = $this->get();
             if (!$this->_res->deleted) {
                 $this->_res->deleted = true;
                 $this->_res->delInfo->deletedBy = $this->_userid;
                 $this->_res->delInfo->deletedOn = date('Y-m-d H:i:s');
                 $this->_res->save();
                 if ($ret !== false) {
                     $this->logAction("delete", $this->getDataType(), $this->_res->id, $ret, null);
                 }
             }
             return $ret;
         }
     } else {
         return false;
     }
 }
Exemple #3
0
 /**
  * @overrides post() from RestResource
  */
 public function post()
 {
     if (parent::post() !== false) {
         return new XMLFragmentRestResponse($this->putpost(RestMethodEnum::RM_POST), $this);
     } else {
         return false;
     }
 }
Exemple #4
0
 public function get()
 {
     if (parent::get() !== false) {
         error_log("[RestAppVAVersionIntegrityItem]: INTEGRITY CHECK FOR vappid: " . $this->_res->vappid . " versionid: " . $this->_res->id);
         //db()->setFetchMode(Zend_Db::FETCH_OBJ);
         //$res = db()->query("SELECT vapp_to_xml(" . $this->getParam("vappid") . ", 'vapplications') AS xml;")->fetchAll();
         $x = array();
         /*foreach($res as $r) {
         			$x[] = $r->xml;
         		}*/
         //$x[] = "<virtualization:lala>lolo</virtualization:lala>";
         //return new XMLRestResponse($x,$this->_parent);
         return new XMLFragmentRestResponse("<virtualization:integrity>not implemented yet</virtualization:integrity>", $this);
         //return new XMLFragmentRestResponse($x, $this);
     } else {
         return false;
     }
 }