Pap_Api_Object::callRequest PHP Method

callRequest() private method

private callRequest ( $method )
        private function callRequest($method)
        {
            $this->message = '';
            $request = new Gpf_Rpc_FormRequest($this->class, $method, $this->session);
            $this->beforeCallRequest($request);
            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;
        }