Gpf_Rpc_Form::existsField PHP Method

existsField() public method

public existsField ( $name )
        public function existsField($name)
        {
            return $this->fields->existsRecord($name);
        }

Usage Example

 /**
  * Get pdf banner preview for merchant
  * 
  * @service banner read
  * @param Gpf_Rpc_Params $params
  */
 public function generatePdfFromHtml(Gpf_Rpc_Params $params) {  
     $form = new Gpf_Rpc_Form($params);   
     if ($form->existsField('html')) {
         $html = $form->getFieldValue('html');
     } else {
         throw new Gpf_Exception($this->_("Html data is not defined"));
     }
     
     if ($form->existsField('fileName')) {
         $fileName = $this->correctFilename($form->getFieldValue('fileName'));
     } else {
         throw new Gpf_Exception($this->_("File name is not defined"));
     }
 	
     if ($form->existsField('affiliate')) {
         try {
             $this->initAffiliate($form->getFieldValue('affiliate'));
         } catch (Gpf_DbEngine_NoRowException $e) {
         	return $this->getFormResponse($this->_('Affiliate is not defined'));
         }
     }
     $html = $this->decodeBanner($html, null, 0);
     $html = htmlspecialchars_decode($html);
     $this->generatePDF($html);
     
     return new Pap_Common_Banner_PdfGeneratorResponse($fileName, $this->pdf);        
 }
All Usage Examples Of Gpf_Rpc_Form::existsField