本文整理汇总了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;
}
}
}