當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dataset::GetFieldValueByName方法代碼示例

本文整理匯總了PHP中Dataset::GetFieldValueByName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dataset::GetFieldValueByName方法的具體用法?PHP Dataset::GetFieldValueByName怎麽用?PHP Dataset::GetFieldValueByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dataset的用法示例。


在下文中一共展示了Dataset::GetFieldValueByName方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: FormatDatasetFieldsTemplate

 public static function FormatDatasetFieldsTemplate(Dataset $dataset, $template, IDelegate $processValue = null)
 {
     $result = $template;
     foreach ($dataset->GetFields() as $field) {
         if ($dataset->IsLookupField($field->GetNameInDataset())) {
             $result = StringUtils::ReplaceVariableInTemplate($result, $field->GetAlias(), $processValue == null ? $dataset->GetFieldValueByName($field->GetAlias()) : $processValue->Call($dataset->GetFieldValueByName($field->GetAlias()), $field->GetAlias()));
         } else {
             $result = StringUtils::ReplaceVariableInTemplate($result, $field->GetName(), $processValue == null ? $dataset->GetFieldValueByName($field->GetNameInDataset()) : $processValue->Call($dataset->GetFieldValueByName($field->GetNameInDataset()), $field->GetNameInDataset()));
         }
     }
     return $result;
 }
開發者ID:howareyoucolin,項目名稱:demo,代碼行數:12,代碼來源:dataset_utils.php

示例2: Render

 /**
  * @param Renderer $renderer
  * @return void
  */
 public function Render(Renderer $renderer)
 {
     /** @var string $term */
     $term = '';
     if ($this->GetSuperGlobals()->IsGetValueSet('term')) {
         $term = $this->GetSuperGlobals()->GetGetValue('term');
     }
     if (!StringUtils::IsNullOrEmpty($term)) {
         $this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . $term . '%', 'ILIKE', true));
     }
     $id = null;
     if ($this->GetSuperGlobals()->IsGetValueSet('id')) {
         $id = $this->GetSuperGlobals()->GetGetValue('id');
     }
     if (!StringUtils::IsNullOrEmpty($id)) {
         $this->dataset->AddFieldFilter($this->idField, FieldFilter::Equals($id));
     }
     header('Content-Type: text/html; charset=utf-8');
     $this->dataset->Open();
     $result = array();
     $valueCount = 0;
     while ($this->dataset->Next()) {
         $result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "value" => StringUtils::IsNullOrEmpty($this->captionTemplate) ? $this->dataset->GetFieldValueByName($this->valueField) : DatasetUtils::FormatDatasetFieldsTemplate($this->dataset, $this->captionTemplate));
         if (++$valueCount >= 20) {
             break;
         }
     }
     echo SystemUtils::ToJSON($result);
     $this->dataset->Close();
 }
開發者ID:martinw0102,項目名稱:ProjetSyst,代碼行數:34,代碼來源:common.php

示例3: Render

 /**
  * @param Renderer $renderer
  * @return void
  */
 public function Render(Renderer $renderer)
 {
     if (GetApplication()->GetSuperGlobals()->IsGetValueSet('term')) {
         $this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . GetApplication()->GetSuperGlobals()->GetGetValue('term') . '%', 'ILIKE', true));
     }
     $this->dataset->Open();
     $result = array();
     $highLightCallback = Delegate::CreateFromMethod($this, 'ApplyHighlight')->Bind(array(Argument::$Arg3 => $this->valueField, Argument::$Arg4 => GetApplication()->GetSuperGlobals()->GetGetValue('term')));
     $this->dataset->SetLimit(20);
     while ($this->dataset->Next()) {
         $result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "label" => $highLightCallback->Call($this->dataset->GetFieldValueByName($this->valueField), $this->valueField), "value" => $this->dataset->GetFieldValueByName($this->valueField));
     }
     echo SystemUtils::ToJSON($result);
     $this->dataset->Close();
 }
開發者ID:howareyoucolin,項目名稱:demo,代碼行數:19,代碼來源:advanced_search_page.php

示例4: RetrieveMasterDatasetValues

 private function RetrieveMasterDatasetValues()
 {
     $hasForeignKeyValues = true;
     for ($i = 0; $i < count($this->masterKeyFields); $i++) {
         if (GetApplication()->GetSuperGlobals()->IsGetValueSet('fk' . $i)) {
             $this->masterDataset->AddFieldFilter($this->masterKeyFields[$i], new FieldFilter($_GET['fk' . $i], '='));
         } else {
             $hasForeignKeyValues = false;
         }
     }
     if ($hasForeignKeyValues) {
         $this->masterDataset->Open();
         if ($this->masterDataset->Next()) {
             for ($i = 0; $i < count($this->parentMasterKeyFields); $i++) {
                 $this->parentMasterKeyValues[] = $this->masterDataset->GetFieldValueByName($this->parentMasterKeyFields[$i]);
             }
         }
         $this->masterDataset->Close();
     }
 }
開發者ID:CivicInfoBC,項目名稱:workplan.gov_ver_1.19,代碼行數:20,代碼來源:page.php

示例5: Render

 /**
  * @param Renderer $renderer
  * @return void
  */
 public function Render(Renderer $renderer)
 {
     $params = ArrayWrapper::createGetWrapper();
     $term = $params->isValueSet('term') ? $params->getValue('term') : '';
     if ($params->isValueSet('term')) {
         $this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . $term . '%', 'ILIKE', true));
     }
     if ($params->isValueSet('id')) {
         $this->dataset->AddFieldFilter($this->idField, FieldFilter::Equals($params->getValue('id')));
     }
     if ($this->itemCount > 0) {
         $this->dataset->SetUpLimit(0);
         $this->dataset->SetLimit($this->itemCount);
     }
     $this->dataset->Open();
     $result = array();
     $highLightCallback = Delegate::CreateFromMethod($this, 'ApplyHighlight')->Bind(array(Argument::$Arg3 => $this->valueField, Argument::$Arg4 => $term));
     while ($this->dataset->Next()) {
         $result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "label" => $highLightCallback->Call($this->dataset->GetFieldValueByName($this->valueField), $this->valueField), "value" => $this->dataset->GetFieldValueByName($this->valueField));
     }
     echo SystemUtils::ToJSON($result);
     $this->dataset->Close();
 }
開發者ID:outsourcinggithub,項目名稱:outsourcing,代碼行數:27,代碼來源:advanced_search_page.php

示例6: SetControlValuesFromDataset

 public function SetControlValuesFromDataset()
 {
     if (GetOperation() == OPERATION_EDIT || GetOperation() == OPERATION_AJAX_REQUERT_INLINE_EDIT) {
         $this->GetEditControl()->SetDisplayValue($this->GetDisplayValueFromDataset());
     } elseif (GetOperation() == OPERATION_COPY) {
         $this->GetEditControl()->SetDisplayValue($this->GetDisplayValueFromDataset());
         /* $masterFieldValue = $this->dataset->GetMasterFieldValueByName($this->fieldName);
            if (isset($masterFieldValue))
                $this->editControl->SetValue($masterFieldValue); */
     } elseif (GetOperation() == OPERATION_INSERT || GetOperation() == OPERATION_AJAX_REQUERT_INLINE_INSERT) {
         $insertDefaultValue = $this->GetInsertDefaultValue();
         if (isset($insertDefaultValue)) {
             $this->lookupDataset->AddFieldFilter($this->lookupIdFieldName, new FieldFilter($insertDefaultValue, '='));
             $this->lookupDataset->Open();
             if ($this->lookupDataset->Next()) {
                 $displayValue = $this->lookupDataset->GetFieldValueByName($this->lookupDisplayFieldName);
                 $this->GetEditControl()->SetDisplayValue($displayValue);
             }
             $this->lookupDataset->Close();
         }
     }
     parent::SetControlValuesFromDataset();
 }
開發者ID:martinw0102,項目名稱:ProjetSyst,代碼行數:23,代碼來源:edit_columns.php

示例7: OnBeforePostHandler

 public function OnBeforePostHandler(Dataset $dataset)
 {
     foreach ($this->getRealEditColumns() as $column) {
         $fieldName = $column->GetFieldName();
         if ($dataset->GetFieldByName($fieldName)) {
             if ($column->getUseHTMLFilter()) {
                 GetApplication()->getHTMLFilter()->setTags($column->getHTMLFilterString());
                 $dataset->SetFieldValueByName($fieldName, GetApplication()->getHTMLFilter()->filter($dataset->GetFieldValueByName($fieldName)));
             }
         }
     }
 }
開發者ID:outsourcinggithub,項目名稱:outsourcing,代碼行數:12,代碼來源:grid_state.php

示例8: Render

 /**
  * @param Renderer $renderer
  * @return void
  */
 public function Render(Renderer $renderer)
 {
     /** @var string $term */
     $term = '';
     if ($this->GetSuperGlobals()->IsGetValueSet('term')) {
         $term = $this->GetSuperGlobals()->GetGetValue('term');
     }
     if (!StringUtils::IsNullOrEmpty($term)) {
         $this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . $term . '%', 'ILIKE', true));
     }
     header('Content-Type: text/html; charset=utf-8');
     $this->dataset->Open();
     $result = array();
     $valueCount = 0;
     $highLightCallback = Delegate::CreateFromMethod($this, 'ApplyHighlight')->Bind(array(Argument::$Arg3 => $this->valueField, Argument::$Arg4 => $term));
     while ($this->dataset->Next()) {
         $result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "value" => StringUtils::IsNullOrEmpty($this->captionTemplate) ? $this->dataset->GetFieldValueByName($this->valueField) : DatasetUtils::FormatDatasetFieldsTemplate($this->dataset, $this->captionTemplate, $highLightCallback));
         if ($valueCount >= 20) {
             break;
         }
     }
     echo SystemUtils::ToJSON($result);
     $this->dataset->Close();
 }
開發者ID:howareyoucolin,項目名稱:demo,代碼行數:28,代碼來源:common.php


注:本文中的Dataset::GetFieldValueByName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。