Esempio n. 1
0
 /**
  * Get specific data from an asn.1 structure  based on configuration
  * @param type $data the ASN.1 data struture
  * @param type $config the configuration of the data to retrive.
  * @return Array an array containing flatten asn.1 data keyed by the configuration.
  */
 protected function getASNDataByConfig($data, $config, $fields)
 {
     $dataArr = Asn_Base::getDataArray($data, true);
     $valueArr = array();
     foreach ($config as $key => $val) {
         $tmpVal = $this->parseASNData(explode(',', $val), $dataArr, $fields);
         if ($tmpVal !== FALSE) {
             $valueArr[$key] = $tmpVal;
         }
     }
     return count($valueArr) ? $valueArr : false;
 }
Esempio n. 2
0
 /**
  * @see Billrun_Plugin_Interface_IParser::parseTrailer
  */
 public function parseTrailer($type, $data, \Billrun_Parser &$parser)
 {
     if ($this->getName() != $type) {
         return FALSE;
     }
     $trailer = $this->parseASNDataRecur($this->nsnConfig['trailer'], Asn_Base::getDataArray($data, true), $this->nsnConfig['fields']);
     //Billrun_Factory::log()->log(print_r($trailer,1),  Zend_Log::DEBUG);
     return $trailer;
 }