/** * Validate Db_Row * * @param Gpf_DbEngine_Row $row * @throws Gpf_DbEngine_Row_ConstraintException */ public function validate(Gpf_DbEngine_Row $row) { $template = new Gpf_Templates_Template($row->get($this->columnName), '', Gpf_Templates_Template::FETCH_TEXT); if (!$template->isValid()) { $this->throwException(); } }
protected function checkAndSavePayoutInvoice(Gpf_Rpc_Form $form, $templateSource, $settingName) { $template = new Gpf_Templates_Template($templateSource, '', Gpf_Templates_Template::FETCH_TEXT); if ($template->isValid()) { Gpf_Settings::set($settingName, $templateSource); $form->setInfoMessage($this->getInfoMessage()); return; } $form->setErrorMessage($this->_('Invalid Smarty syntax. More information: ') . Gpf_Application::getKnowledgeHelpUrl(Pap_Common_Constants::SMARTY_SYNTAX_URL)); }
protected function checkBeforeSave(Gpf_DbEngine_RowBase $row, Gpf_Rpc_Form $form, $operationType = self::EDIT) { $template = new Gpf_Templates_Template($row->getExportRowTemplate(), '', Gpf_Templates_Template::FETCH_TEXT); if (!$template->isValid()) { $form->setErrorMessage($this->_('Invalid Smarty syntax. More information: ') . Gpf_Application::getKnowledgeHelpUrl(Pap_Common_Constants::SMARTY_SYNTAX_URL)); return false; } return true; }