本文整理匯總了PHP中PluginDatainjectionCommonInjectionLib::findSearchOption方法的典型用法代碼示例。如果您正苦於以下問題:PHP PluginDatainjectionCommonInjectionLib::findSearchOption方法的具體用法?PHP PluginDatainjectionCommonInjectionLib::findSearchOption怎麽用?PHP PluginDatainjectionCommonInjectionLib::findSearchOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PluginDatainjectionCommonInjectionLib
的用法示例。
在下文中一共展示了PluginDatainjectionCommonInjectionLib::findSearchOption方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addValueToInject
/**
* Add a value to the fields to inject
*
* @param $fields_toinject the fields
* @param $searchOptions options related to the itemtype to inject
* @param $mapping the mapping which matches the field
* @param $value the value for this field, as readed from the CSV file
* @param $several array of all fields which can be mapping more than one time
* in the model
* @return nothing
**/
function addValueToInject(&$fields_toinject, $searchOptions, $mapping, $value, $several = array())
{
// Option will be found only for "main" type.
$option = PluginDatainjectionCommonInjectionLib::findSearchOption($searchOptions, $mapping->getValue());
$return_value = $value;
if ($option['displaytype'] == 'multiline_text' && in_array($mapping->getValue(), $several) && $value != PluginDatainjectionCommonInjectionLib::EMPTY_VALUE) {
$return_value = '';
if (isset($fields_toinject[$mapping->getItemtype()][$mapping->getValue()])) {
$return_value .= $fields_toinject[$mapping->getItemtype()][$mapping->getValue()];
}
$return_value .= $mapping->getMappingName() . "=" . $value . "\n";
}
$fields_toinject[$mapping->getItemtype()][$mapping->getValue()] = $return_value;
}
示例2: keepInfo
/**
* @param $info PluginDatainjectionInfo object
* @param $value
**/
static function keepInfo(PluginDatainjectionInfo $info, $value)
{
$itemtype = $info->getInfosType();
$injectionClass = PluginDatainjectionCommonInjectionLib::getInjectionClassInstance($itemtype);
$options = $injectionClass->getOptions($itemtype);
$option = PluginDatainjectionCommonInjectionLib::findSearchOption($options, $info->getValue());
if ($option) {
switch ($option['displaytype']) {
default:
case 'text':
case 'multiline_text':
if ($value != PluginDatainjectionCommonInjectionLib::EMPTY_VALUE) {
return true;
}
return false;
case 'dropdown':
case 'user':
case 'contact':
if ($value != PluginDatainjectionCommonInjectionLib::DROPDOWN_EMPTY_VALUE) {
return true;
}
return false;
}
}
}