/** * Get version of installed application * * @return string version of installed application */ public function getAppVersion() { $request = new Gpf_Rpc_FormRequest("Gpf_Api_AuthService", "getAppVersion"); $request->setUrl($this->url); try { $request->sendNow(); } catch (Exception $e) { $this->setMessage("Connection error: " . $e->getMessage()); return false; } $form = $request->getForm(); return $form->getFieldValue('version'); }
private function callRequest($method) { $this->message = ''; $request = new Gpf_Rpc_FormRequest($this->class, $method, $this->session); foreach ($this->getFields() as $field) { if ($field->get(self::FIELD_VALUE) != null) { $request->setField($field->get(self::FIELD_NAME), $field->get(self::FIELD_VALUE)); } } try { $request->sendNow(); } catch (Gpf_Exception $e) { if (strpos($e->getMessage(), 'Row does not exist') !== false) { throw new Exception("Row with this ID does not exist"); } } $form = $request->getForm(); if ($form->isError()) { $this->message = $form->getErrorMessage(); $this->addErrorMessages($form->getFields()); return false; } else { $this->message = $form->getInfoMessage(); } $this->setFields($form->getFields()); $this->afterCallRequest(); return true; }