Esempio n. 1
0
    public function __construct(Gpf_Api_Session $session) {
        $this->session = $session;
        $this->fields = new Gpf_Data_IndexedRecordSet(self::FIELD_NAME);

        $header = new Gpf_Data_RecordHeader();
        $header->add(self::FIELD_NAME);
        $header->add(self::FIELD_VALUE);
        $header->add(self::FIELD_VALUES);
        $header->add(self::FIELD_ERROR);

        $this->fields->setHeader($header);
    }
Esempio n. 2
0
 public function __construct(Gpf_Rpc_Params $params = null)
 {
     $this->fields = new Gpf_Data_IndexedRecordSet(self::FIELD_NAME);
     $header = new Gpf_Data_RecordHeader();
     $header->add(self::FIELD_NAME);
     $header->add(self::FIELD_VALUE);
     $header->add(self::FIELD_VALUES);
     $header->add(self::FIELD_ERROR);
     $this->fields->setHeader($header);
     $this->validator = new Gpf_Rpc_Form_Validator_FormValidatorCollection($this);
     if ($params) {
         $this->loadFieldsFromArray($params->get("fields"));
     }
 }
Esempio n. 3
0
 /**
  * Create instance to handle DataRequest
  *
  * @param Gpf_Rpc_Params $params
  */
 public function __construct(Gpf_Rpc_Params $params = null)
 {
     if ($params === null) {
         $params = new Gpf_Rpc_Params();
     }
     $this->filters = new Gpf_Rpc_FilterCollection($params);
     $this->params = new Gpf_Data_IndexedRecordSet(self::NAME);
     $this->params->setHeader(array(self::NAME, self::VALUE));
     if ($params->exists(self::DATA) !== null) {
         $this->loadParamsFromArray($params->get(self::DATA));
     }
     $this->id = $params->get(self::ID);
     $this->response = new Gpf_Data_IndexedRecordSet(self::NAME);
     $this->response->setHeader(array(self::NAME, self::VALUE));
 }
Esempio n. 4
0
    /**
     * @return Gpf_Data_RecordSet
     */
    public function getResult() {
        $result = new Gpf_Data_IndexedRecordSet('id');

        $result->setHeader(Gpf_View_Column::getMetaResultArray());
        foreach ($this->_columns as $column) {
            if($column->isInHeader()) {
                $result->add($column->getResultArray());
            }
        }
        return $result;
    }
 /**
  * Compute active languages recordset from install directory language files
  *
  * @return Gpf_Data_IndexedRecordSet
  */
 public function getActiveLanguagesNoRpc()
 {
     $result = new Gpf_Data_IndexedRecordSet('code');
     $result->setHeader(array(Gpf_Db_Table_Languages::CODE, Gpf_Db_Table_Languages::NAME, Gpf_Db_Table_Languages::ENGLISH_NAME, Gpf_Db_Table_Languages::IS_DEFAULT));
     $langCacheDirectory = Gpf_Paths::getInstance()->getInstallDirectoryPath() . Gpf_Paths::CACHE_DIRECTORY . Gpf_Lang_Dictionary::LANGUAGE_DIRECTORY;
     foreach (new Gpf_Io_DirectoryIterator($langCacheDirectory) as $file) {
         if (preg_match('!^' . Gpf_Application::getInstance()->getCode() . '_(.+)\\.s\\.php$!', $file, $matches)) {
             $language = $this->loadLanguage($matches[1]);
             $result->add(array($matches[1], $language->getName(), $language->getEnglishName(), Gpf::NO));
         }
     }
     return $result;
 }
Esempio n. 6
0
 private function addPlugins()
 {
     $plugins = new Gpf_Data_IndexedRecordSet('name');
     $plugins->setHeader(array('name'));
     foreach (Gpf_Plugins_Engine::getInstance()->getConfiguration()->getActivePlugins() as $pluginCode) {
         $plugins->add(array($pluginCode));
     }
     Gpf_Rpc_CachedResponse::addById($plugins, self::PLUGINS);
 }
 /**
  * @return Gpf_Rpc_Params
  */
 protected function createSignupParams() {
     $fields = new Gpf_Data_IndexedRecordSet('name');
     $fields->setHeader(new Gpf_Data_RecordHeader(array('name', 'value')));
     $this->fillSignupParams($fields);
     
     $params = new Gpf_Rpc_Params();
     $params->add('fields', $fields->toObject());
     
     return $params;
 }
	/**
	 * @param $params
	 * @return Gpf_Data_IndexedRecordSet
	 */
	protected function getRowFromSpecialTypes($commTypeValue) {
		$commTypes = new Gpf_Data_IndexedRecordSet(Pap_Db_Table_CommissionTypes::ID);
		$commTypes->setHeader($this->createHeaderArray());
		$this->addSpecialTypes($commTypes);
		$this->translateCommTypes($commTypes);
		$commType = $commTypes->toShalowRecordSet();
		try {
			$commType->addRecord($commTypes->getRecord($commTypeValue));
		} catch (Gpf_Data_RecordSetNoRowException $e) {
		}
		return $commType;
	}
 /**
  * @return Gpf_Data_IndexedRecordSet
  */
 public function getAllViewColumns() {
     $columns = new Gpf_Data_IndexedRecordSet('id');
     $columns->setHeader(Gpf_View_ViewColumn::getMetaResultArray());
     foreach ($this->viewColumns as $viewColumn) {
         $columns->add($viewColumn->getResultArray());
     }
     return $columns;
 }