getHeader() public method

public getHeader ( ) : Gpf_Data_RecordHeader
return Gpf_Data_RecordHeader
 /**
  * Load role privileges
  *
  * @service
  * @anonym
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Data_RecordSet
  */
 public function loadRolePrivileges(Gpf_Rpc_Params $params)
 {
     if (!Gpf_Session::getAuthUser()->hasPrivilege(Gpf_Privileges::ROLE, Gpf_Privileges::P_READ) && !Gpf_Session::getAuthUser()->hasPrivilege(Gpf_Privileges::ROLE, Pap_Privileges::P_READ_OWN)) {
         throw new Gpf_Rpc_PermissionDeniedException('Gpf_Role_RolePrivilegesForm', 'loadRolePrivileges');
     }
     $role = new Gpf_Db_Role();
     $role->setId($params->get('roleid'));
     $role->load();
     $defaultPrivileges = Gpf_Application::getInstance()->getDefaultPrivilegesByRoleType($role->getRoleType());
     $result = new Gpf_Data_RecordSet();
     $result->addColumn('object');
     $result->addColumn('objectName');
     $result->addColumn('possiblePrivileges');
     $result->addColumn('activePrivileges');
     $rolePrivileges = Gpf_Privileges::loadPrivileges($role->getId());
     foreach ($defaultPrivileges->getDefaultPrivileges() as $object => $privileges) {
         $record = new Gpf_Data_Record($result->getHeader());
         $record->add('object', $object);
         $record->add('objectName', ucfirst(str_replace('_', ' ', strtolower($object))));
         $allTypes = $defaultPrivileges->getObjectToTypeRelation();
         $record->add('possiblePrivileges', implode(',', $allTypes[$object]));
         if (array_key_exists($object, $rolePrivileges)) {
             $record->add('activePrivileges', implode(',', array_keys($rolePrivileges[$object])));
         } else {
             $record->add('activePrivileges', '');
         }
         $result->addRecord($record);
     }
     $result->sort('objectName');
     return $result;
 }
    protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
        $outputResult = new Gpf_Data_RecordSet();
        $outputResult->setHeader($inputResult->getHeader());

        $tree = new Pap_Features_BannersCategories_Tree(false);
        foreach ($inputResult as $record) {
            if ($record->get('code')=='0' || $record->get('selected')=='N') {
                continue;
            }

            $newRecord = new Gpf_Data_Record($inputResult->getHeader());
            $newRecord->add('name', $this->_localize($tree->getBreadcrumb($record->get('id'), ' > ')));
            $newRecord->add('id', $record->get('id'));

            $outputResult->add($newRecord);
        }
        return $outputResult;
    }
    protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
        $outputResult = new Gpf_Data_RecordSet();
        $outputResult->setHeader($inputResult->getHeader());

        $tree = new Pap_Features_BannersCategories_Tree(false);
        foreach ($inputResult as $record) {
            if ($record->get('code')=='0') {
                $this->_count--;
                continue;
            }

            $newRecord = new Gpf_Data_Record($inputResult->getHeader());
            $newRecord->add('name', $record->get('name'));
            $newRecord->add('id', $record->get('id'));
            $newRecord->add('state', $record->get('state'));
            $newRecord->add('depth', $record->get('depth'));


            $outputResult->add($newRecord);
        }
        return $outputResult;
    }
 /**
  * Proxy request from server to Addons web server and return list of Integration methods
  * @service integration_methods read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Data_RecordSet
  */
 private function getIntegrationMethodsList(Gpf_Rpc_Params $params) {
     $proxyRequest = new Gpf_Rpc_Request('Aw_Db_Table_Integrations', 'getIntegrationsList');
     $this->sendRequest($proxyRequest, $params);     
     
     $recordSet = new Gpf_Data_RecordSet();
     $recordSet->loadFromObject($proxyRequest->getResponseObject()->toObject());
     $header = $recordSet->getHeader()->getIds();
     $header[0] = "id";
     $recordSet->setHeader($header);
     
     $this->processIntegrations($recordSet);
     
     return $recordSet;
 }
	private function addCommissions(Gpf_Data_RecordSet $rs ) {
	    $cTable = Pap_Db_Table_Commissions::getInstance();
        $rsCommissions = $cTable->getAllCommissionsInCampaign('', '');
        $rs->addColumn('commissions', 'N');
        
        $newRs = new Gpf_Data_RecordSet();
        $newRs->setHeader($rs->getHeader());
        
        foreach ($rs as $record) {
        	if($cTable->findCampaignInCommExistsRecords($record->get("id"), $rsCommissions)) {
        		$record->set('commissions', $this->getCommissionsDescription($record->get("id"), $rsCommissions));
        		$newRs->addRecord($record);
        	}
        }

        return $newRs;		
	}
 /**
  * @param Gpf_Data_RecordSet $affiliateScreens
  * @return Gpf_Data_RecordSet
  */
 private function updateAffiliateScreensRecordSet(Gpf_Data_RecordSet $affiliateScreens) {
     $header = $affiliateScreens->getHeader();
     $header->add(self::ID);
     $header->add(self::VALUE);
     foreach ($affiliateScreens as $record) {
         if ($record->get(Pap_Db_Table_AffiliateScreens::PARAMS) != null) {
             $id = $record->get(Pap_Db_Table_AffiliateScreens::CODE) . ';' . $record->get(Pap_Db_Table_AffiliateScreens::PARAMS);
         } else {
             $id = $record->get(Pap_Db_Table_AffiliateScreens::CODE);
         }
         $record->add(self::ID, $id);
         $record->add(self::VALUE, $this->_localize($record->get(Pap_Db_Table_AffiliateScreens::TITLE)));
     }
     
     return $affiliateScreens;
 }
 protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
     $outputResult = new Gpf_Data_RecordSet();
     
     $campaignFilter = $this->filters->getFilter('campaignid');
     if (count($campaignFilter)>0) {
         $filterValue = $campaignFilter[0]->getValue();
         $categories = $this->getCampaignCategories($filterValue);
     }
     
     foreach ($inputResult as $record) {
         if ($record->get('code')=='0') {
             continue;
         }
         $record->set('name', $this->_localize($record->get('name')));
         if (count($campaignFilter)>0) {
             $filterValue = $campaignFilter[0]->getValue();
             
             if (in_array($record->get('code'), $categories)) {
                 $record->add('selected', 'Y');
             } else {
                 $record->add('selected', 'N');
             }
         }
         $outputResult->add($record);
     }
     $outputResult->setHeader($inputResult->getHeader());
     $outputResult->getHeader()->add('selected');
     return $outputResult;
 }
	protected function initAffiliateCampaigns() {
		$this->affiliateCampaigns = new Gpf_Data_RecordSet();
		$this->affiliateCampaigns->setHeader($this->campaigns->getHeader()->toArray());
	}
 /**
  * Created result RecordSet from data columns.
  * Can be overridden to add more columns to the result RecordSet
  *
  * @return Gpf_Data_RecordSet
  */
 protected function initResult() {
     $result = new Gpf_Data_RecordSet();
     foreach ($this->dataColumns as $column) {
         $result->getHeader()->add($column->getId());
     }
     return $result;
 }
 public function getJSONString($withRoot = true, $states = null)
 {
     if ($this->mpttArray == null) {
         throw new Gpf_Exception('No tree Records were set! There are no data to create JSON string');
     }
     $levels = array();
     $stack = 0;
     $oldDepth = -1;
     $headers = $this->getHeaders($this->mpttArray->getHeader());
     $oldStates = array();
     foreach ($this->mpttArray as $row) {
         $depth = $row->get('depth');
         // code, depth   //name,visible
         if ($depth == $oldDepth) {
             //no level change
             if (count($oldStates) > 0) {
                 array_pop($oldStates);
             }
             array_push($oldStates, $row->get('state'));
             if ($this->checkPrevioursStatesAreCorrect($oldStates, $states)) {
                 $levels[$depth][] = $this->createObject($row, $headers);
             }
         }
         if ($depth > $oldDepth) {
             //level raised
             array_push($oldStates, $row->get('state'));
             if ($this->checkPrevioursStatesAreCorrect($oldStates, $states)) {
                 $levels[$depth][] = $this->createObject($row, $headers);
             }
             $stack = $depth;
         }
         if ($depth < $oldDepth) {
             //level drop
             while ($stack > $depth) {
                 $stack--;
                 array_pop($oldStates);
                 if ($this->checkPrevioursStatesAreCorrect($oldStates, $states)) {
                     $array = $this->cloneArray($levels[$stack + 1]);
                     $levels[$stack][count($levels[$stack]) - 1]->items = $array;
                     unset($levels[$stack + 1]);
                 }
             }
             array_pop($oldStates);
             array_push($oldStates, $row->get('state'));
             if ($this->checkPrevioursStatesAreCorrect($oldStates, $states)) {
                 $levels[$depth][] = $this->createObject($row, $headers);
             }
         }
         $oldDepth = $depth;
     }
     while ($stack > 0) {
         $stack--;
         array_pop($oldStates);
         if ($this->checkPrevioursStatesAreCorrect($oldStates, $states)) {
             if (array_key_exists($stack + 1, $levels)) {
                 $levels[$stack][count($levels[$stack]) - 1]->items = $this->cloneArray($levels[$stack + 1]);
                 unset($levels[$stack + 1]);
             }
         }
     }
     $json = new Gpf_Rpc_Json();
     if ($withRoot) {
         return $json->encode($levels[0]);
     }
     if (array_key_exists(0, $levels)) {
         return $json->encode($levels[0][0]->items);
     }
     return 'null';
 }
 /**
  * @return Gpf_Data_RecordSet
  */
 protected function initResult() {
     $result = new Gpf_Data_RecordSet();
     foreach ($this->dataColumns as $column) {            
         if (array_key_exists($column->getId(), $this->statColumns) && !$this->isColumnRequired($column->getId())) {
             continue;
         }
         if ($this->isColumnRequired($column->getId()) || $this->filters->isFilter($column->getId())) {
              $result->getHeader()->add($column->getId());
         }
     }
     return $result;
 }