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


PHP Gpf_Data_RecordSet类代码示例

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


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

示例1: decode

 /**
  * @param array $requestArray
  * @return StdClass
  */
 function decode($requestArray)
 {
     $param = new stdClass();
     $reservedParams = array(Gpf_Rpc_Params::CLASS_NAME, Gpf_Rpc_Params::METHOD_NAME, Gpf_Rpc_Params::SESSION_ID, Gpf_Rpc_Server::FORM_REQUEST, Gpf_Rpc_Server::FORM_RESPONSE);
     $recordset = new Gpf_Data_RecordSet();
     $recordset->setHeader(array("name", "value"));
     foreach ($requestArray as $name => $value) {
         if (in_array($name, $reservedParams)) {
             continue;
         }
         if (get_magic_quotes_gpc()) {
             $value = stripslashes($value);
         }
         $record = $recordset->createRecord();
         $record->set("name", $name);
         $record->set("value", $value);
         $recordset->add($record);
     }
     $param->fields = $recordset->toObject();
     foreach ($reservedParams as $paramName) {
         if (array_key_exists($paramName, $requestArray)) {
             $param->{$paramName} = $requestArray[$paramName];
         }
     }
     return $param;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:30,代码来源:FormHandler.class.php

示例2: saveFields

    /**
     * @service channel write
     *
     * @param $fields
     * @return Gpf_Rpc_Action
     */
    public function saveFields(Gpf_Rpc_Params $params) {
        $action = new Gpf_Rpc_Action($params);
        $action->setErrorMessage($this->_('Failed to save %s field(s)'));
        $action->setInfoMessage($this->_('%s field(s) successfully saved'));
        
        $fields = new Gpf_Data_RecordSet();
        $fields->loadFromArray($action->getParam("fields"));
        
        $channels = Pap_Db_Table_Channels::getUserChannels(Gpf_Session::getAuthUser()->getPapUserId());
        
        foreach ($fields as $field) {
        	$isUnique = true;
        	foreach ($channels as $channel) {
        		if ($field->get('value') == $channel->get(Pap_Db_Table_Channels::VALUE)) {
        			$isUnique = false;
        			break;
        		}
        	}
        	if ($isUnique) {
        		$this->saveField($field);
        	} else {
        		$action->setErrorMessage($this->_("Failed to save %s field(s). Data with value '".$field->get('value').
        		  "' already exist. Data must be unique."));
        		$action->addError();
        		return $action;
        	}
        }

        $action->addOk();

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

示例3: saveFieldsRpc

    protected function saveFieldsRpc(Gpf_Rpc_Params $params) {
        $action = new Gpf_Rpc_Action($params);
        $action->setErrorMessage($this->_('Failed to save %s field(s) in %s(s)', '%s', $this->getDbRowObjectName()));
        $action->setInfoMessage($this->_('%s field(s) in %s(s) successfully saved', '%s', $this->getDbRowObjectName()));

        $fields = new Gpf_Data_RecordSet();
        $fields->loadFromArray($action->getParam("fields"));


        foreach ($fields as $field) {
            $dbRow = $this->createDbRowObject();
            $dbRow->setPrimaryKeyValue($field->get(Gpf_Db_Table_FormFields::ID));
            $dbRow->load();
            $dbRow->setName($field->get(Gpf_Db_Table_FormFields::NAME));
            $dbRow->setStatus($field->get(Gpf_Db_Table_FormFields::STATUS));
            $dbRow->setType($field->get(Gpf_Db_Table_FormFields::TYPE));
            if ($field->get(Gpf_Db_Table_FormFields::AVAILABLEVALUES) != null) {
                $dbRow->setAvailableValues($field->get(Gpf_Db_Table_FormFields::AVAILABLEVALUES));
            }
            $dbRow->save();
            $action->addOk();
        }

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

示例4: getActionTypes

    /**
     * @service campaign read
     * @return Gpf_Data_RecordSet
     */
    public function getActionTypes(Gpf_Rpc_Params $params) {
        $actionTypesHeader = array(Pap_Db_Table_CommissionTypes::TYPE, Pap_Db_Table_CommissionTypes::NAME, Pap_Db_Table_CommissionTypes::ID, 'campaignName');

        $data = new Gpf_Rpc_Data($params);
        $filters = $data->getFilters();

        $statsParams = new Pap_Stats_Params();
        $statsParams->setCampaignId($filters->getFilterValue('campaignid'));
        $statsParams->setBannerId($filters->getFilterValue('bannerid'));

        $transactionTypeStats = new Pap_Stats_TransactionTypeStats($statsParams);
        $transactionTypes = $transactionTypeStats->getTypes();

        $actionTypesRecordSet = new Gpf_Data_RecordSet();
        $actionTypesRecordSet->setHeader($actionTypesHeader);

        $this->initActionCampaignNames();

        foreach ($transactionTypes as $transactionType) {
            if ($transactionType->getType() != Pap_Common_Constants::TYPE_SALE && $transactionType->getType() !=Pap_Common_Constants::TYPE_ACTION && $transactionType->getType() != Pap_Common_Constants::TYPE_RECURRING) {
                continue;
            }
            $actionTypesRecordSet->add(new Gpf_Data_Record($actionTypesHeader, array($transactionType->getType(), $transactionType->getName(), $transactionType->getCommissionTypeId(), $this->getActionCampaignName($transactionType->getCommissionTypeId()))));
        }
        return $actionTypesRecordSet;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:30,代码来源:TransactionTypes.class.php

示例5: getNumberOfSubaffiliates

    public function getNumberOfSubaffiliates($userid = null) {
        $result = new Gpf_Data_RecordSet();
        $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('COUNT(u.userid)', 'amount');

        $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.deleted', '=', Gpf::NO);
        if ($userid === null) {
            $selectBuilder->where->add('u.parentuserid', '=', Gpf_Session::getAuthUser()->getPapUserId());
        } else {
            $selectBuilder->where->add('u.parentuserid', '=', $userid);
        }
        $selectBuilder->where->add('gu.rstatus', '<>', 'D');
        if ($this->params->isDateFromDefined()) {
            $selectBuilder->where->add('u.' . Pap_Stats_Table::DATEINSERTED, '>=', $this->params->getDateFrom()->toDateTime());
        }
        if ($this->params->isDateToDefined()) {
            $selectBuilder->where->add('u.' . Pap_Stats_Table::DATEINSERTED, '<=', $this->params->getDateTo()->toDateTime());
        }
        $selectBuilder->limit->set(0, 1);

        $result->load($selectBuilder);

        if($result->getSize() == 0) {
            return 0;
        }

        foreach($result as $record) {
            return $record->get('amount');
        }
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:34,代码来源:SubAffiliateStats.class.php

示例6: saveRolePrivileges

 /**
  * Save role privileges
  *
  * @service role write
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function saveRolePrivileges(Gpf_Rpc_Params $params)
 {
     $form = new Gpf_Rpc_Form($params);
     $role = new Gpf_Db_Role();
     $role->setId($form->getFieldValue('roleid'));
     $role->load();
     if (!strlen($role->getAccountId())) {
         $form->setErrorMessage($this->_('It is not possible to changes privileges for default role %s', $role->getName()));
         return $form;
     }
     //delete all privileges for selected role
     Gpf_Db_Table_RolePrivileges::getInstance()->deleteAllPrivileges($role->getId());
     //insert all privileges again to database
     $objects = new Gpf_Data_RecordSet();
     $objects->loadFromArray($form->getFieldValue('objects'));
     foreach ($objects as $record) {
         $rights = explode(',', $record->get('privileges'));
         foreach ($rights as $right) {
             $privilege = new Gpf_Db_RolePrivilege();
             $privilege->setObject($record->get('object'));
             $privilege->setRoleId($role->getId());
             $privilege->setPrivilege($right);
             $privilege->insert();
         }
     }
     $form->setInfoMessage($this->_('Changes saved'));
     return $form;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:35,代码来源:RolePrivilegesForm.class.php

示例7: save

 /**
  * @service mail_template write
  * @param $fields
  * @return Gpf_Rpc_Form
  */
 public function save(Gpf_Rpc_Params $params)
 {
     $form = new Gpf_Rpc_Form($params);
     try {
         $mailTemplate = $this->loadMailTemplate($form->getFieldValue('templateid'));
     } catch (Gpf_Exception $e) {
         $form->setErrorMessage($this->_('Failed to load mail template with error: %s', $e->getMessage()));
         return $form;
     }
     try {
         $className = $mailTemplate->get(Gpf_Db_Table_MailTemplates::CLASS_NAME);
         $objTemplate = new $className();
         $templateVariables = new Gpf_Data_RecordSet();
         $templateVariables->setHeader(array('id', 'value'));
         foreach ($objTemplate->getTemplateVariables() as $code => $name) {
             $record = $templateVariables->createRecord();
             $record->set('id', $code);
             $record->set('value', $form->getFieldValue('var_' . $code));
             $templateVariables->add($record);
         }
         $objTemplate->setCachedVariableValues($templateVariables);
         $objTemplate->addRecipient($form->getFieldValue('recipient'));
         $objTemplate->sendNow();
     } catch (Gpf_Exception $e) {
         $form->setErrorMessage($this->_('Failed to send test mail with error: %s', $e->getMessage()));
         return $form;
     }
     $form->setInfoMessage($this->_('Test mail was successfully queued'));
     return $form;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:35,代码来源:MailTemplateTestForm.class.php

示例8: setData

 private function setData(Gpf_Data_RecordSet $recordSet, $totalCount = null)
 {
     $this->cachedData = $recordSet;
     if ($totalCount == null) {
         $this->size = $this->cachedData->getSize();
         return;
     }
     $this->size = $totalCount;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:9,代码来源:RichListBox.class.php

示例9: getAvailableLanguages

 /**
  *
  * @return Gpf_Data_RecordSet
  */
 private function getAvailableLanguages()
 {
     $languages = new Gpf_Data_RecordSet();
     $languages->setHeader(array('id', 'name'));
     foreach (new Gpf_Lang_InstallLanguages() as $language) {
         $languages->add(array($language->getCode(), $language->getExtendedName()));
     }
     return $languages;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:13,代码来源:SelectLanguage.class.php

示例10: loadWrapperNames

 /**
  * @service banner_format_setting read
  * @return Gpf_Data_RecordSet
  */
 public function loadWrapperNames(Gpf_Rpc_Params $params) {
     $row = new Pap_Db_BannerWrapper();
     $collection = $row->loadCollection();
     $result = new Gpf_Data_RecordSet();
     $result->setHeader(array('id', 'name'));
     foreach ($collection as $row){
         $result->add(array($row->getId(), $row->getName()));
     }
     return $result;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:14,代码来源:BannerWrapperService.class.php

示例11: loadDataTypes

 /**
  * returns data for chart
  *
  * @service trend_stats read
  * @param $fields
  * @return Gpf_Rpc_Chart
  */
 public function loadDataTypes(Gpf_Rpc_Params $params) {
     $this->initCampaignId($params);
     $this->initDataTypes();
     $recordSet = new Gpf_Data_RecordSet();
     $recordSet->setHeader(array("id", "value"));
     foreach ($this->dataTypes as $dataType) {
         $recordSet->add(array($dataType->getId(), $dataType->getName()));
     }
     return $recordSet;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:17,代码来源:StatisticsBase.class.php

示例12: getTemplateVariables

 /**
  * Load list of template variables for custom template
  *
  * @service mail_template read
  * @param Gpf_Rpc_Params $params
  */
 public function getTemplateVariables(Gpf_Rpc_Params $params)
 {
     $recordSet = new Gpf_Data_RecordSet();
     $recordSet->setHeader(array('code', 'name'));
     //TODO - treba prerobit cez extension point ... v pap newsletter feature budu premenne definovane cez Pap_Mail_UserMail
     $objTemplate = new Pap_Mail_UserMail();
     foreach ($objTemplate->getTemplateVariables() as $code => $name) {
         $recordSet->add(array($code, $name));
     }
     return $recordSet;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:17,代码来源:SendBroadcastMail.class.php

示例13: fillFromUser

 private function fillFromUser(Gpf_Rpc_Form $form, Pap_Affiliates_User $user) {
     $userData = new Gpf_Data_RecordSet();
     $userData->setHeader(array('userid', 'username','firstname', 'lastname'));
     $data = $userData->createRecord();
     $data->add('userid', $user->getId());
     $data->add('username', $user->getUserName());
     $data->add('firstname', $user->getFirstName());
     $data->add('lastname', $user->getLastName());
     $userData->add($data);
     $form->setField('userid', null, $userData->toObject());
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:11,代码来源:OfflineSaleForm.class.php

示例14: getAllPrivileges

 /**
  * @param string $roleId
  * @return Gpf_Data_RecordSet
  */
 public function getAllPrivileges($roleId)
 {
     $select = new Gpf_SqlBuilder_SelectBuilder();
     $select->select->add(self::ID, 'id');
     $select->select->add(self::OBJECT, 'object');
     $select->select->add(self::PRIVILEGE, 'privilege');
     $select->from->add(self::getName());
     $select->where->add(self::ROLE_ID, "=", $roleId);
     $privileges = new Gpf_Data_RecordSet();
     $privileges->load($select);
     return $privileges;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:16,代码来源:RolePrivileges.class.php

示例15: getCampaignRecordSetForAffiliate

    private function getCampaignRecordSetForAffiliate() {
        $selectBuilder = $this->createSelectBuilder();
        $selectBuilder->select->add('c.'.Pap_Db_Table_Campaigns::STATUS, 'rstatus');
        $selectBuilder->select->add('c.'.Pap_Db_Table_Campaigns::TYPE, 'rtype');
        Gpf_Plugins_Engine::extensionPoint('Pap_Common_Campaign_CampaignForAffiliateRichListBox.getCampaignRecordSetForAffiliate', 
        new Pap_Affiliates_Promo_SelectBuilderCompoundFilter($selectBuilder));

        $result = new Gpf_Data_RecordSet();
        $result->load($selectBuilder);
        
        return $result;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:12,代码来源:CampaignForAffiliateRichListBox.class.php


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