本文整理汇总了PHP中ca_objects::getConfigurationForCurrentLocationType方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getConfigurationForCurrentLocationType方法的具体用法?PHP ca_objects::getConfigurationForCurrentLocationType怎么用?PHP ca_objects::getConfigurationForCurrentLocationType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getConfigurationForCurrentLocationType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: relationshipChangeMayAffectCurrentLocation
/**
* Determines is a change being made to the object's relationships maight affect current location. I
*
* @param mixed $pm_rel_table_name_or_num Table bame or number of the related table
* @param int $pn_rel_id Primary key of the record being related to the object
* @param mixed $pm_type_id Type_id or type code for relationship
* @param array $pa_options No options are currently supported.
*
* @return bool
*/
private function relationshipChangeMayAffectCurrentLocation($pm_rel_table_name_or_num, $pn_rel_id, $pm_type_id = null, $pa_options = null)
{
if (!$pn_rel_id) {
return true;
}
// null record means we are batch deleting so go ahead and recalculate
if (!($t_instance = $this->getAppDatamodel()->getInstance($pm_rel_table_name_or_num, true))) {
return null;
}
if (($vs_table_name = $t_instance->tableName()) !== 'ca_storage_locations') {
$pm_type_id = $t_instance->getTypeID($pn_rel_id);
}
if (ca_objects::getConfigurationForCurrentLocationType($pm_rel_table_name_or_num, $pm_type_id)) {
return true;
}
return false;
}
示例2: getFacetContent
//.........这里部分代码省略.........
$va_collapse_map = $this->getCollapseMapForLocationFacet($va_facet_info);
$va_values = $va_values_by_table = array();
while ($qr_res->nextRow()) {
if (!($vs_loc_class = trim($qr_res->get('current_loc_class')))) {
continue;
}
if (!($vs_loc_subclass = trim($qr_res->get('current_loc_subclass')))) {
continue;
}
if (!($vs_loc_id = trim($qr_res->get('current_loc_id')))) {
continue;
}
$vs_val = "{$vs_loc_class}:{$vs_loc_subclass}:{$vs_loc_id}";
if ($va_criteria[$vs_val]) {
continue;
}
// skip items that are used as browse critera - don't want to browse on something you're already browsing on
$va_values_by_table[$vs_loc_class][$vs_loc_subclass][$vs_loc_id] = true;
}
foreach ($va_values_by_table as $vs_loc_class => $va_loc_id_by_subclass) {
foreach ($va_loc_id_by_subclass as $vs_loc_subclass => $va_loc_ids) {
if (sizeof($va_tmp = array_keys($va_loc_ids))) {
$vs_loc_table_name = $this->opo_datamodel->getTableName($vs_loc_class);
if (($vs_table_name = $vs_loc_table_name) == 'ca_objects_x_storage_locations') {
$vs_table_name = 'ca_storage_locations';
}
$qr_res = caMakeSearchResult($vs_table_name, $va_tmp);
if (isset($va_collapse_map[$vs_table_name]) && isset($va_collapse_map[$vs_table_name]['*']) && $va_collapse_map[$vs_table_name]['*']) {
$va_values[$vs_id = "{$vs_loc_class}"] = array('id' => $vs_id, 'label' => $va_collapse_map[$vs_table_name]['*']);
continue;
}
while ($qr_res->nextHit()) {
$vn_id = $qr_res->getPrimaryKey();
$va_config = ca_objects::getConfigurationForCurrentLocationType($vs_table_name, $vs_loc_subclass, array('facet' => isset($va_facet_info['display']) ? $va_facet_info['display'] : null));
$vs_template = isset($va_config['template']) ? $va_config['template'] : "^{$vs_table_name}.preferred_labels";
if (isset($va_collapse_map[$vs_table_name]) && isset($va_collapse_map[$vs_table_name][$vs_loc_subclass]) && $va_collapse_map[$vs_table_name][$vs_loc_subclass]) {
$va_values[$vs_id = "{$vs_loc_class}:{$vs_loc_subclass}"] = array('id' => $vs_id, 'label' => $va_collapse_map[$vs_table_name][$vs_loc_subclass]);
continue;
}
$va_values[$vs_id = "{$vs_loc_class}:{$vs_loc_subclass}:{$vn_id}"] = array('id' => $vs_id, 'label' => $qr_res->getWithTemplate($vs_template));
}
}
}
}
if (!is_null($vs_single_value) && !$vb_single_value_is_present) {
return array();
}
return caSortArrayByKeyInValue($va_values, array('label'));
}
return array();
break;
# -----------------------------------------------------
# -----------------------------------------------------
case 'fieldList':
$t_item = $this->opo_datamodel->getInstanceByTableName($vs_browse_table_name, true);
$vs_field_name = $va_facet_info['field'];
$va_field_info = $t_item->getFieldInfo($vs_field_name);
$t_list = new ca_lists();
$t_list_item = new ca_list_items();
$va_joins = array();
$va_wheres = array();
$vs_where_sql = '';
if (isset($va_field_info['LIST_CODE']) && ($vs_list_name = $va_field_info['LIST_CODE'])) {
// Handle fields containing ca_list_item.item_id's
$va_joins = array('INNER JOIN ' . $vs_browse_table_name . ' ON ' . $vs_browse_table_name . '.' . $vs_field_name . ' = li.item_id', 'INNER JOIN ca_lists ON ca_lists.list_id = li.list_id');
if (sizeof($va_results) && $this->numCriteria() > 0) {
示例3: renderBundleForDisplay
/**
*
*/
public function renderBundleForDisplay($ps_bundle_name, $pn_row_id, $pa_values, $pa_options = null)
{
switch ($ps_bundle_name) {
case 'ca_objects_location':
if (!is_array($pa_values) || !sizeof($pa_values)) {
return null;
}
$va_values = array_shift($pa_values);
if (!is_array($va_values) || !sizeof($va_values)) {
return null;
}
$va_values = array_shift($va_values);
$vn_loc_class = $va_values['current_loc_class'];
$vn_loc_subclass = $va_values['current_loc_subclass'];
$vn_loc_id = $va_values['current_loc_id'];
$vs_loc_table_name = $this->getAppDatamodel()->getTableName($vn_loc_class);
$t_instance = $this->getAppDatamodel()->getInstanceByTableName($vs_loc_table_name, true);
if (($vs_table_name = $vs_loc_table_name) == 'ca_objects_x_storage_locations') {
$vs_table_name = 'ca_storage_locations';
}
if (($qr_res = caMakeSearchResult($vs_table_name, array($vn_loc_id))) && $qr_res->nextHit()) {
// Return label for id
$va_config = ca_objects::getConfigurationForCurrentLocationType($vs_table_name, $vn_loc_subclass);
$vs_template = isset($va_config['template']) ? $va_config['template'] : "^{$vs_table_name}.preferred_labels";
return caTruncateStringWithEllipsis($qr_res->getWithTemplate($vs_template), 30, 'end');
}
break;
}
return null;
}