当前位置: 首页>>代码示例>>PHP>>正文


PHP Gpf_Data_RecordSet::addColumn方法代码示例

本文整理汇总了PHP中Gpf_Data_RecordSet::addColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Data_RecordSet::addColumn方法的具体用法?PHP Gpf_Data_RecordSet::addColumn怎么用?PHP Gpf_Data_RecordSet::addColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gpf_Data_RecordSet的用法示例。


在下文中一共展示了Gpf_Data_RecordSet::addColumn方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterExecute

    protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
        $inputResult->addColumn(Pap_Db_Table_Payouts::AMOUNT);
        $inputResult->addColumn('users');

        $payoutHistoryIds = array();
        foreach ($inputResult as $record) {
            $payoutHistoryIds[] = $record->get('id');
        }

        $outputResult = $inputResult->toShalowRecordSet();

        $payeeData = $this->getPayeeData($payoutHistoryIds);

        foreach ($inputResult as $record) {
            $payoutHistoryId = $record->get('id');
            if(!isset($payeeData[$payoutHistoryId])) {
                $record->set(Pap_Db_Table_Payouts::AMOUNT, 0);
                $record->set("users", "");
            } else {
                if (!$this->matchesSearchCriteria($record, $payeeData[$payoutHistoryId])) {
                    $this->_count--;
                    continue;
                }
                $record->set("amount", $payeeData[$payoutHistoryId]['amount']);
                $record->set("users", $payeeData[$payoutHistoryId]['usersCount'].' '.
                ($payeeData[$payoutHistoryId]['usersCount'] > 1 ? $this->_("payees") : $this->_("payee")));
            }
            $outputResult->addRecord($record);
        }
        return $outputResult;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:31,代码来源:PayoutsHistoryGrid.class.php

示例2: loadRolePrivileges

 /**
  * 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;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:39,代码来源:RolePrivilegesForm.class.php

示例3: getThemesNoRpc

 /**
  * @return Gpf_Data_RecordSet
  */
 public function getThemesNoRpc($panelName, $filterDisabled = false)
 {
     $response = new Gpf_Data_RecordSet();
     $response->addColumn(Gpf_Desktop_Theme::ID);
     $response->addColumn(Gpf_Desktop_Theme::NAME);
     $response->addColumn(Gpf_Desktop_Theme::AUTHOR);
     $response->addColumn(Gpf_Desktop_Theme::URL);
     $response->addColumn(Gpf_Desktop_Theme::DESCRIPTION);
     $response->addColumn(Gpf_Desktop_Theme::THUMBNAIL);
     $response->addColumn(Gpf_Desktop_Theme::DESKTOP_MODE);
     $response->addColumn(Gpf_Desktop_Theme::ENABLED);
     $response->addColumn(Gpf_Desktop_Theme::BUILT_IN);
     $iterator = new Gpf_Io_DirectoryIterator(Gpf_Paths::getInstance()->getTopTemplatePath() . $panelName, '', false, true);
     foreach ($iterator as $fullName => $themeId) {
         if ($themeId == rtrim(Gpf_Paths::DEFAULT_THEME, '/')) {
             continue;
         }
         try {
             $theme = new Gpf_Desktop_Theme($themeId, $panelName);
             if ($filterDisabled && !$theme->isEnabled()) {
                 continue;
             }
             $response->addRecord($theme->toRecord($response));
         } catch (Gpf_Exception $e) {
             Gpf_Log::error($e->getMessage());
         }
     }
     return $response;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:32,代码来源:ThemeManager.class.php

示例4: clearAvailableValues

 public function clearAvailableValues()
 {
     $this->availableValues = new Gpf_Data_RecordSet();
     $this->availableValues->addColumn('id');
     $this->availableValues->addColumn('name');
     $this->setAvailableValues("");
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:7,代码来源:FormField.class.php

示例5: getRows

 /**
  * Returns row data for grid
  *
  * @service language read
  *
  * @param $filters
  * @param $limit
  * @param $offset
  * @param $sort_col
  * @param $sort_asc
  * @param Gpf_Data_RecordSet $columns
  * @return Gpf_Rpc_Serializable
  */
 public function getRows(Gpf_Rpc_Params $params)
 {
     $this->_params = $params;
     $this->_sortColumn = $params->get('sort_col');
     $this->_sortAsc = $params->get('sort_asc');
     $this->_requiredColumns = new Gpf_Data_IndexedRecordSet('id');
     $this->_requiredColumns->loadFromArray($params->get('columns'));
     $response = new Gpf_Rpc_Object();
     $recordHeader = new Gpf_Data_RecordHeader();
     $result = new Gpf_Data_RecordSet();
     foreach ($this->getAllViewColumns() as $column) {
         $result->addColumn($column->get('id'));
         $recordHeader->add($column->get('id'));
     }
     $result->addColumn('id');
     $recordHeader->add('id');
     $languagesIterator = new Gpf_Io_DirectoryIterator(Gpf_Paths::getInstance()->getLanguageInstallDirectory(), 'csv', false);
     $languagesCount = 0;
     foreach ($languagesIterator as $fullName => $file) {
         if (preg_match('/^' . Gpf_Application::getInstance()->getCode() . '_(.+)\\.csv$/', $file, $matches)) {
             $file = new Gpf_Io_Csv_Reader($fullName, ';', '"', array('source', 'translation', 'type', 'module', 'status', 'customer'));
             $language = new Gpf_Lang_CsvLanguage();
             $language->loadFromCsvFile($file, true);
             $languagesCount++;
             $record = new Gpf_Data_Record($recordHeader);
             $record->set('id', $fullName);
             $record->set(Gpf_Db_Table_Languages::CODE, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_CODE));
             $record->set(Gpf_Db_Table_Languages::NAME, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_NAME));
             $record->set(Gpf_Db_Table_Languages::ENGLISH_NAME, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_ENG_NAME));
             $record->set(Gpf_Db_Table_Languages::TRANSLATED_PERCENTAGE, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_TRANSLATION_PERCENTAGE));
             $record->set(Gpf_Db_Table_Languages::AUTHOR, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_AUTHOR));
             $record->set(Gpf_Db_Table_Languages::VERSION, $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_VERSION));
             $result->addRecord($record);
         }
     }
     $response->rows = $result->toObject();
     $response->count = $languagesCount;
     return $response;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:52,代码来源:AddLanguageGrid.class.php

示例6: afterExecute

 protected function afterExecute(Gpf_Data_RecordSet $inputResult)
 {
     $inputResult->addColumn('default', Gpf::NO);
     $defaultCountry = Gpf_Settings::get(Gpf_Settings_Gpf::DEFAULT_COUNTRY);
     foreach ($inputResult as $country) {
         if ($country->get(Gpf_Db_Table_Countries::COUNTRY_CODE) == $defaultCountry) {
             $country->set('country', $this->_localize($country->get('country')) . ' ' . $this->_('(default)'));
             $country->set('default', Gpf::YES);
             continue;
         }
         $country->set('country', $this->_localize($country->get('country')));
     }
     return $inputResult;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:14,代码来源:CountriesGrid.class.php

示例7: afterExecute

 /**
  *
  * @param Gpf_Data_RecordSet $inputResult
  * @return Gpf_Data_RecordSet
  */
 protected function afterExecute(Gpf_Data_RecordSet $inputResult)
 {
     $inputResult->addColumn("size", null);
     foreach ($inputResult as $record) {
         $fileData = $this->getFileData($record->get(Gpf_Db_Table_Exports::FILENAME));
         if (count($fileData) > 1) {
             $record->set("size", $fileData[1]);
         } else {
             $record->set(Gpf_Db_Table_Exports::FILENAME, $fileData[0]);
             $record->set("size", 0);
         }
     }
     return $inputResult;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:19,代码来源:ServerExportFilesGrid.class.php

示例8: addCommissions

	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;		
	}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:17,代码来源:Campaigns.class.php

示例9: afterExecute

    /**
     *
     * @param Gpf_Data_RecordSet $inputResult
     * @return Gpf_Data_RecordSet
     */
    protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
    	$inputResult->addColumn('commissionOverview', 'N');
    	
        $cTable = Pap_Db_Table_Commissions::getInstance();
        $rsCommissions = $cTable->getAllCommissionsInCampaign();

        foreach ($inputResult as $record) {
        	
            if($cTable->findCampaignInCommExistsRecords($record->get(Pap_Db_Table_Campaigns::ID),
                $rsCommissions)) {
                $record->set('commissionOverview', $cTable->getCommissionsDescription($record->get(Pap_Db_Table_Campaigns::ID),
                    $rsCommissions, $record->get('id')));
            }
        }

        return $inputResult;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:22,代码来源:CommissionGroupsGrid.class.php

示例10: loadSelectedWallpaperNoRpc

 /**
  * Get recordset of all selected wallpaper
  *
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Data_RecordSet
  */
 public function loadSelectedWallpaperNoRpc()
 {
     $response = new Gpf_Data_RecordSet();
     $response->addColumn(self::WALLPAPER_TYPE);
     $response->addColumn(self::WALLPAPER_POSITION);
     $response->addColumn(self::BACKGROUND_COLOR);
     $response->addColumn("fileId");
     $response->addColumn("url");
     $record = $response->createRecord();
     try {
         Gpf_Db_Table_UserAttributes::getInstance()->loadAttributes(Gpf_Session::getAuthUser()->getAccountUserId());
         $wallpaperType = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER_TYPE, self::TYPE_THEME);
         $theme = new Gpf_Desktop_Theme();
         $wallpaperId = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER, $theme->getDefaultWallpaper());
         $position = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER_POSITION, $theme->getDefaultWallpaperPosition());
         $color = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::BACKGROUND_COLOR, $theme->getDefaultBackgroundColor());
         $record->set(self::WALLPAPER_POSITION, $position);
         $record->set(self::BACKGROUND_COLOR, $color);
         $record->set(self::WALLPAPER_TYPE, $wallpaperType);
         if ($wallpaperType == self::TYPE_THEME) {
             $record->set("url", Gpf_Paths::getInstance()->getResourceUrl($wallpaperId, Gpf_Paths::IMAGE_DIR . Gpf_Paths::WALLPAPER_DIR));
         } else {
             if ($wallpaperType == self::TYPE_CUSTOM) {
                 $wallpaper = new Gpf_Db_Wallpaper();
                 $wallpaper->setPrimaryKeyValue($wallpaperId);
                 $wallpaper->load();
                 $record->set("fileId", $wallpaper->getFileId());
                 $record->set("url", $wallpaper->getUrl());
             }
         }
     } catch (Gpf_Exception $e) {
         $theme = new Gpf_Desktop_Theme();
         $record->set(self::WALLPAPER_POSITION, "S");
         $record->set(self::BACKGROUND_COLOR, "#000000");
         $record->set(self::WALLPAPER_TYPE, self::TYPE_NONE);
         $record->set("fileId", null);
         $record->set("url", "");
     }
     $response->addRecord($record);
     return $response;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:47,代码来源:WallPaper.class.php

示例11: loadItems

    protected function loadItems($itemId, $lastTier = false)  {
        $result = new Gpf_Data_RecordSet();

        $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->addAll(Pap_Db_Table_Users::getInstance(), 'u');
        $selectBuilder->select->add('au.username', 'username');
        $selectBuilder->select->add('au.firstname', 'firstname');
        $selectBuilder->select->add('au.lastname', 'lastname');
        $selectBuilder->select->add('au.'.Gpf_Db_Table_AuthUsers::NOTIFICATION_EMAIL, Gpf_Db_Table_AuthUsers::NOTIFICATION_EMAIL);

        $selectBuilder->from->add(Pap_Db_Table_Users::getName(), "u");
        $selectBuilder->from->addInnerJoin(Gpf_Db_Table_Users::getName(), "gu", "u.accountuserid = gu.accountuserid");
        $selectBuilder->from->addInnerJoin(Gpf_Db_Table_AuthUsers::getName(), "au", "gu.authid = au.authid");

        $selectBuilder->where->add('u.rtype', '=', Pap_Application::ROLETYPE_AFFILIATE);

        $selectBuilder->limit->set(0, 50);

        $this->filterCollection->addTo($selectBuilder->where);

        $this->addWhereCondition($selectBuilder, $itemId);

        $result->load($selectBuilder);


        $result->addColumn("subaffiliates", 0);
        if (!$lastTier) {
            $record = $this->addSubaffiliatesCount($result);
        }

        return $result;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:32,代码来源:AffiliateTreeBase.class.php

示例12: loadSideBarNoRpc

 /**
  * @return Gpf_Rpc_Form
  */
 public function loadSideBarNoRpc()
 {
     $response = new Gpf_Data_RecordSet();
     $response->addColumn("name");
     $response->addColumn("value");
     $record = $response->createRecord();
     $record->set("name", "width");
     $sideBarWidthValue = $this->getUserAttributeWithDefaultValue(self::SIDEBAR_WIDTH_SETTING_NAME, "200");
     if ($sideBarWidthValue < 0) {
         $sideBarWidthValue = 200;
     }
     $record->set("value", $sideBarWidthValue);
     $response->add($record);
     $record = $response->createRecord();
     $record->set("name", "hidden");
     $record->set("value", $this->getUserAttributeWithDefaultValue(self::SIDEBAR_HIDDEN_SETTING_NAME, "N"));
     $response->add($record);
     $record = $response->createRecord();
     $record->set("name", "onTop");
     $record->set("value", $this->getUserAttributeWithDefaultValue(self::SIDEBAR_ONTOP_SETTING_NAME, Gpf_Settings::get(Gpf_Settings_Gpf::SIDEBAR_DEFAULT_ONTOP)));
     $response->add($record);
     return $response;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:26,代码来源:Rpc.php

示例13: load

 /**
  * returns available plugins
  *
  * @service plugin read
  * @param $fields
  */
 public function load(Gpf_Rpc_Params $params)
 {
     $availablePlugins = Gpf_Plugins_Engine::getInstance()->getAvailablePlugins();
     if ($params->exists("type")) {
         $type = $params->get("type");
     } else {
         $type = Gpf_Plugins_Definition::PLUGIN_TYPE_NORMAL;
     }
     $response = new Gpf_Data_RecordSet();
     $response->addColumn(Gpf_Plugins_Definition::CODE);
     $response->addColumn(Gpf_Plugins_Definition::NAME);
     $response->addColumn(Gpf_Plugins_Definition::URL);
     $response->addColumn(Gpf_Plugins_Definition::DESCRIPTION);
     $response->addColumn(Gpf_Plugins_Definition::VERSION);
     $response->addColumn(Gpf_Plugins_Definition::AUTHOR);
     $response->addColumn(Gpf_Plugins_Definition::AUTHOR_URL);
     $response->addColumn(Gpf_Plugins_Definition::ACTIVE);
     $response->addColumn(Gpf_Plugins_Definition::HELP);
     $response->addColumn(Gpf_Plugins_Definition::CONFIG_CLASS_NAME);
     foreach ($availablePlugins as $plugin) {
         if ($plugin->getPluginType() == $type) {
             $response->addRecord($plugin->toRecord($response));
         }
     }
     $response = $this->setActivePlugins($response);
     return $response;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:33,代码来源:PluginsList.class.php

示例14: addCampaignDetails

    private function addCampaignDetails(Gpf_Data_RecordSet $inputResult) {
        $inputResult->addColumn('campaigndetails');

        $commissionsTable = Pap_Db_Table_Commissions::getInstance();
        $allCommissions = $commissionsTable->getAllCommissionsInCampaign();
        $campaignCommissions = array();

        foreach ($inputResult as $record) {
            $campaignId = $record->get('campaignid');
            if (!array_key_exists($campaignId, $campaignCommissions)) {
                $campaign = new Pap_Db_Campaign();
                $campaign->setId($campaignId);
                $commissionGroupId = $campaign->checkUserIsInCampaign(Gpf_Session::getAuthUser()->getPapUserId());
                if ($commissionGroupId == false) {
                    $commissionGroupId = null;
                }
                $campaignCommissions[$campaignId] =  $commissionsTable->getCommissionsDescription($campaignId,$allCommissions,$commissionGroupId);
            }
            $record->set('campaigndetails', $campaignCommissions[$campaignId]);
        }
        return $inputResult;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:22,代码来源:BannersGrid.class.php


注:本文中的Gpf_Data_RecordSet::addColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。