本文整理汇总了PHP中Gpf_Data_RecordSet::addRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Data_RecordSet::addRecord方法的具体用法?PHP Gpf_Data_RecordSet::addRecord怎么用?PHP Gpf_Data_RecordSet::addRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gpf_Data_RecordSet
的用法示例。
在下文中一共展示了Gpf_Data_RecordSet::addRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addValue
public function addValue($code, $value)
{
$record = $this->recordSet->createRecord();
$record->set(self::CODE, $code);
$record->set(self::VALUE, $value);
$this->recordSet->addRecord($record);
}
示例2: addData
public function addData(Gpf_Data_Row $record)
{
$this->lastRecord = $this->data->createRecord();
$this->lastRecord->set(self::WIDGET_ID, $this->id++ . "");
foreach ($this->lastRecord as $name => $value) {
if ($name == self::WIDGET_ID) {
continue;
}
if ($this->lastRecord->contains($name)) {
$this->lastRecord->set($name, $record->get($name) . "");
}
}
$this->data->addRecord($this->lastRecord);
}
示例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;
}
示例4: 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;
}
示例5: addAvailableValue
public function addAvailableValue($value, $label)
{
$record = $this->availableValues->createRecord();
$record->set('id', $value);
$record->set('name', $label);
$this->availableValues->addRecord($record);
$json = new Gpf_Rpc_Json();
$this->setAvailableValues($json->encodeResponse($this->availableValues));
}
示例6: addField
private function addField($caption, $code, $type, $status, $help = '', $values = array())
{
$record = $this->fieldsRecordset->createRecord();
$record->set('id', '0');
$record->set('code', $code);
$record->set('name', $caption);
$record->set('help', $help);
$record->set('type', $type);
$record->set('status', $status);
if (count($values) > 0) {
$valuesRecordSet = new Gpf_Data_RecordSet();
$valuesRecordSet->setHeader(array("id", "value"));
foreach ($values as $id => $value) {
if ($id != '') {
$valuesRecordSet->add(array($id, $value));
}
}
$json = new Gpf_Rpc_Json();
$record->set('availablevalues', $json->encode($valuesRecordSet->toObject()));
}
$this->fieldsRecordset->addRecord($record);
}
示例7: getSteps
/**
*
* @return Gpf_Data_RecordSet
*/
public function getSteps()
{
$steps = new Gpf_Data_RecordSet();
$steps->setHeader(array(self::STEP_CODE, self::STEP_NAME, 'selected'));
foreach ($this->steps as $index => $step) {
$record = $steps->createRecord();
$record->set(self::STEP_CODE, $step->getCode());
$record->set(self::STEP_NAME, $step->getName());
if ($this->currentStep == $index) {
$record->set('selected', Gpf::YES);
} else {
$record->set('selected', Gpf::NO);
}
$steps->addRecord($record);
}
return $steps;
}
示例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;
}
示例9: listPop3WithDisk
/**
*
* @return Gpf_Data_RecordSet
*/
public function listPop3WithDisk($popDomain, $nearquotaonly = null, $no_validate = null, $regex = null)
{
$xml = $this->execute('/xml-api/cpanel', array('cpanel_xmlapi_version' => 2, 'cpanel_xmlapi_module' => 'Email', 'cpanel_xmlapi_func' => 'listpopswithdisk', 'domain' => $popDomain, 'nearquotaonly' => $nearquotaonly, 'no_validate' => $no_validate, 'regex' => $regex, 'cache_fix' => rand()));
$result = new Gpf_Data_RecordSet();
$result->setHeader(array(self::DISKQUOTA, self::DISKUSEDPERCENT, self::DISKUSED, self::HUMANDISKQUOTA, self::LOGIN, self::EMAIL, self::DOMAIN, self::USER, self::HUMANDISKUSED));
foreach ($xml->data as $row) {
$record = $result->createRecord();
$record->add(self::DISKQUOTA, (string) $row->diskquota);
$record->add(self::DISKUSEDPERCENT, (string) $row->diskusedpercent);
$record->add(self::DISKUSED, (string) $row->diskused);
$record->add(self::HUMANDISKQUOTA, (string) $row->humandiskquota);
$record->add(self::LOGIN, (string) $row->login);
$record->add(self::EMAIL, (string) $row->email);
$record->add(self::DOMAIN, (string) $row->domain);
$record->add(self::USER, (string) $row->user);
$record->add(self::HUMANDISKUSED, (string) $row->humandiskused);
$result->addRecord($record);
}
return $result;
}
示例10: getIIFFile
/**
* @service payout_history export
* @return Gpf_Rpc_Serializable
*/
public function getIIFFile(Gpf_Rpc_Params $params) {
$this->initParamsForCSVFile($params);
$views = $params->get("columns");
$header = array();
for ($i = 2; $i < count($views); $i++) {
if ($views[$i][0] === self::ACTIONS) {
continue;
}
$header[] = $views[$i][0];
}
if (!in_array('payouthistoryid', $header)) {
$header[] = 'payouthistoryid';
}
if (!in_array('amount', $header)) {
$header[] = 'amount';
}
if (!in_array('merchantnote', $header)) {
$header[] = 'merchantnote';
}
if (!in_array('affiliatenote', $header)) {
$header[] = 'affiliatenote';
}
$viewResult = new Gpf_Data_RecordSet();
$viewResult->setHeader($header);
$payoutHistoryIds = array();
$result = $this->getResultForCSV();
if ($result->getSize() > 0) {
foreach ($result as $record) {
$row = new Gpf_Data_Record($header);
foreach ($header as $column) {
$row->set($column, $record->get($column));
}
$row = $this->addAffiliateInfo($row);
$viewResult->addRecord($row);
$payoutHistoryIds[] = $row->get('payouthistoryid');
}
}
if ($this->_fileName != null) {
$fileName = $this->_fileName.".iif";
} else {
$fileName = "grid.iif";
}
$affiliates = $this->getUsersFromPayouts($payoutHistoryIds);
$iifGenerator = new QuickBooks_GeneratorResponse($fileName, $viewResult, $affiliates);
return $iifGenerator->generateFile();
}
示例11: dumpZone
/**
* List One Zone — dumpzone
* This function displays the DNS zone configuration for a specific domain.
*
* @return Gpf_Data_RecordSet Returns recordset of dns entry records
*/
public function dumpZone($domain)
{
$xml = $this->execute('/xml-api/dumpzone', array('domain' => $domain));
$records = new Gpf_Data_RecordSet();
$records->setHeader(array('name', 'Line', 'address', 'class', 'exchange', 'preference', 'expire', 'minimum', 'mname', 'nsdname', 'cname', 'raw', 'refresh', 'retry', 'rname', 'serial', 'ttl', 'type', 'txtdata'));
foreach ($xml->result->record as $record) {
$dnsRecord = $records->createRecord();
$dnsRecord->set('name', (string) $record->name);
$dnsRecord->set('Line', (string) $record->Line);
$dnsRecord->set('address', (string) $record->address);
$dnsRecord->set('class', (string) $record->class);
$dnsRecord->set('exchange', (string) $record->exchange);
$dnsRecord->set('preference', (string) $record->preference);
$dnsRecord->set('expire', (string) $record->expire);
$dnsRecord->set('minimum', (string) $record->minimum);
$dnsRecord->set('mname', (string) $record->mname);
$dnsRecord->set('nsdname', (string) $record->nsdname);
$dnsRecord->set('cname', (string) $record->cname);
$dnsRecord->set('raw', (string) $record->raw);
$dnsRecord->set('refresh', (string) $record->refresh);
$dnsRecord->set('retry', (string) $record->retry);
$dnsRecord->set('rname', (string) $record->rname);
$dnsRecord->set('serial', (string) $record->serial);
$dnsRecord->set('ttl', (string) $record->ttl);
$dnsRecord->set('type', (string) $record->type);
$dnsRecord->set('txtdata', (string) $record->txtdata);
$records->addRecord($dnsRecord);
}
return $records;
}
示例12: 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;
}
示例13: createOperatorsRecordSet
/**
* @param array<Gpf_SqlBuilder_Operator> $operators
* @return Gpf_Data_RecordSet
*/
private function createOperatorsRecordSet($operators) {
$recordSet = new Gpf_Data_RecordSet();
$header = new Gpf_Data_RecordHeader();
$header->add(self::OPERATOR_CODE);
$header->add(self::OPERATOR_NAME);
$recordSet->setHeader($header);
foreach ($operators as $operator) {
$record = $recordSet->createRecord();
$record->set(self::OPERATOR_CODE, $operator->getCode());
$record->set(self::OPERATOR_NAME, $operator->getName());
$recordSet->addRecord($record);
}
return $recordSet;
}
示例14: 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;
}
示例15: addField
protected function addField(Gpf_Data_RecordSet $fields, $name, $value) {
$r1 = $fields->createRecord();
$r1->set('name', $name);
$r1->set('value', $value);
$fields->addRecord($r1);
}