本文整理汇总了PHP中StringUtils::Contains方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtils::Contains方法的具体用法?PHP StringUtils::Contains怎么用?PHP StringUtils::Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtils
的用法示例。
在下文中一共展示了StringUtils::Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: QuoteTableIndetifier
public function QuoteTableIndetifier($identifier)
{
if (StringUtils::Contains(StringUtils::Lower($identifier), 'select')) {
return $identifier;
}
$result = '';
$parts = StringUtils::SplitString('.', $identifier);
foreach ($parts as $part) {
AddStr($result, StringUtils::NormalizeQuotation($part, $this->GetFirstQuoteChar(), $this->GetLastQuoteChar()), '.');
}
return $result;
}
示例2: GetFilterRowViewData
public function GetFilterRowViewData()
{
$result = array();
$result['Columns'] = array();
$advancedSearch = $this->GetPage()->AdvancedSearchControl;
$bands = $this->GetViewBands();
$isActionButtonPositionLeft = $bands[0]->GetName() == 'actions';
if ($advancedSearch && $this->GetFilterRowAvailable()) {
foreach ($this->GetViewBands() as $band) {
foreach ($band->GetColumns() as $column) {
$searchColumnViewData = null;
$columnName = $this->GetDataset()->IsLookupField($column->GetName()) ? $this->GetDataset()->IsLookupFieldNameByDisplayFieldName($column->GetName()) : $column->GetName();
$searchColumn = null;
if ($column instanceof CustomDatasetFieldViewColumn || $column instanceof CustomFormatValueViewColumnDecorator || $column instanceof ImageViewColumn) {
$searchColumn = $advancedSearch->FindSearchColumnByName($columnName);
}
if ($searchColumn) {
$searchColumnViewData = array();
$searchColumnViewData['FieldName'] = $columnName;
$searchColumnViewData['Value'] = $searchColumn->GetValue();
$searchColumnViewData['Attributes'] = '';
if ($searchColumn instanceof DateTimeSearchColumn) {
$searchColumnViewData['Attributes'] = 'data-calendar="true" ' . 'data-picker-format="' . $searchColumn->GetOSDateTimeFormat() . '" ' . 'data-picker-first-day-of-week="' . GetFirstDayOfWeek() . '" ';
if (StringUtils::Contains($searchColumn->GetOSDateTimeFormat(), ":")) {
$searchColumnViewData['Attributes'] .= 'data-picker-show-time="true"';
}
} else {
if ($searchColumn instanceof LookupSearchColumn) {
$searchColumnViewData['Attributes'] = 'data-pg-typeahead="true" ' . 'data-pg-typeahead-handler="' . $searchColumn->GetHandlerName() . '" ' . 'data-post-value="' . $searchColumn->GetValue() . '"';
if ($searchColumn->getItemCount() > 0) {
$searchColumnViewData['Attributes'] .= ' data-pg-typeahead-count="' . $searchColumn->getItemCount() . '"';
}
$searchColumnViewData['Value'] = $searchColumn->GetDisplayValue();
}
}
if ($searchColumn->IsFilterActive()) {
$searchColumnViewData['CurrentOperator'] = SearchFilterOperator::GetOperatorByName($searchColumn->GetFilterIndex())->GetViewData($this->GetPage()->GetLocalizerCaptions());
} else {
$defaultFilter = 'CONTAINS';
$availableFilterTypes = array_keys($searchColumn->GetAvailableFilterTypes());
if (count($availableFilterTypes) > 0) {
$defaultFilter = $availableFilterTypes[0];
}
$searchColumnViewData['CurrentOperator'] = SearchFilterOperator::GetOperatorByName($defaultFilter)->GetViewData($this->GetPage()->GetLocalizerCaptions());
}
$searchColumnViewData['Operators'] = $searchColumn->GetAvailableFilterTypesViewData();
}
$result['Columns'][$column->GetName()] = $searchColumnViewData;
}
}
$result['TimerInterval'] = $advancedSearch->getTimerInterval();
$tempArray = array();
$resetButtonPlacementColumnName = null;
foreach ($this->GetViewBands() as $band) {
foreach ($band->GetColumns() as $column) {
$searchColumnViewData = null;
$columnName = $this->GetDataset()->IsLookupField($column->GetName()) ? $this->GetDataset()->IsLookupFieldNameByDisplayFieldName($column->GetName()) : $column->GetName();
$searchColumn = null;
if ($column instanceof CustomDatasetFieldViewColumn || $column instanceof CustomFormatValueViewColumnDecorator || $column instanceof ImageViewColumn) {
$searchColumn = $advancedSearch->FindSearchColumnByName($columnName);
}
if ($searchColumn) {
$tempArray[] = array('Name' => $columnName, 'IsPlacement' => false);
} else {
$tempArray[] = array('Name' => $columnName, 'IsPlacement' => true);
}
}
}
$resetButtonPlacementFound = false;
for ($i = 0; $i < count($tempArray); $i++) {
if (!$tempArray[$i]['IsPlacement'] && $i > 0) {
$result['Columns'][$tempArray[$i - 1]['Name']]['ResetButtonPlacement'] = true;
$result['Columns'][$tempArray[$i - 1]['Name']]['ResetButtonAlignment'] = $isActionButtonPositionLeft ? 'right' : 'left';
$resetButtonPlacementFound = true;
break;
} else {
if (!$tempArray[$i]['IsPlacement']) {
break;
}
}
}
if (!$resetButtonPlacementFound) {
for ($i = count($tempArray) - 1; $i >= 0; $i--) {
if (!$tempArray[$i]['IsPlacement'] && $i < count($tempArray) - 1) {
$result['Columns'][$tempArray[$i + 1]['Name']]['ResetButtonPlacement'] = true;
$result['Columns'][$tempArray[$i + 1]['Name']]['ResetButtonAlignment'] = $isActionButtonPositionLeft ? 'right' : 'left';
$resetButtonPlacementFound = true;
break;
} else {
if (!$tempArray[$i]['IsPlacement']) {
break;
}
}
}
}
}
return $result;
}