本文整理汇总了PHP中caMakeCacheKeyFromOptions函数的典型用法代码示例。如果您正苦于以下问题:PHP caMakeCacheKeyFromOptions函数的具体用法?PHP caMakeCacheKeyFromOptions怎么用?PHP caMakeCacheKeyFromOptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caMakeCacheKeyFromOptions函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFieldsToIndex
/**
* Fetch list of fields to index for the subject table
*
* @param mixed $pm_subject_table Name or number of table indexing is to be applied to
* @param mixed $pm_content_table Name or number of table containing content being indexed. [Default is $pm_subject_table]
*
* @return array
*/
public function getFieldsToIndex($pm_subject_table, $pm_content_table = null, $pa_options = null)
{
$vs_key = caMakeCacheKeyFromOptions($pa_options);
if (isset(SearchBase::$s_fields_to_index_cache[$pm_subject_table . '/' . $pm_content_table . '/' . $vs_key])) {
return SearchBase::$s_fields_to_index_cache[$pm_subject_table . '/' . $pm_content_table . '/' . $vs_key];
}
if (is_numeric($pm_subject_table)) {
$vs_subject_table = $this->opo_datamodel->getTableName($pm_subject_table);
} else {
$vs_subject_table = $pm_subject_table;
}
if ($pm_content_table == null) {
$vs_content_table = $vs_subject_table;
} else {
if (is_numeric($pm_content_table)) {
$vs_content_table = $this->opo_datamodel->getTableName($pm_content_table);
} else {
$vs_content_table = $pm_content_table;
}
}
if (!($va_info = $this->opo_search_indexing_config->getAssoc($vs_subject_table))) {
return SearchBase::$s_fields_to_index_cache[$pm_subject_table . '/' . $pm_content_table . '/' . $vs_key] = SearchBase::$s_fields_to_index_cache[$vs_subject_table . '/' . $vs_content_table . '/' . $vs_key] = null;
}
$va_fields_to_index = $va_info[$vs_content_table]['fields'];
$t_subject = $this->opo_datamodel->getInstanceByTableName($vs_content_table, false);
if (caGetOption('intrinsicOnly', $pa_options, false)) {
unset($va_fields_to_index['_metadata']);
foreach ($va_fields_to_index as $vs_f => $va_data) {
if (substr($vs_f, 0, 14) === '_ca_attribute_') {
unset($va_fields_to_index[$vs_f]);
continue;
}
if (!$t_subject->hasField($vs_f)) {
unset($va_fields_to_index[$vs_f]);
continue;
}
if ($vs_start = $t_subject->getFieldInfo($vs_f, 'START') && ($vs_end = $t_subject->getFieldInfo($vs_f, 'END'))) {
$va_fields_to_index[$vs_start] = $va_data;
$va_fields_to_index[$vs_end] = $va_data;
unset($va_fields_to_index[$vs_f]);
}
}
return $va_fields_to_index;
}
// Expand "_metadata" to all available metadata elements
if (isset($va_fields_to_index['_metadata'])) {
$va_data = $va_fields_to_index['_metadata'];
unset($va_fields_to_index['_metadata']);
$va_field_data = $t_subject->getApplicableElementCodes(null, false, false);
foreach ($va_field_data as $vn_element_id => $vs_element_code) {
$va_fields_to_index['_ca_attribute_' . $vn_element_id] = $va_data;
}
}
// Convert specific attribute codes to element_ids
if (is_array($va_fields_to_index)) {
foreach ($va_fields_to_index as $vs_f => $va_info) {
if (substr($vs_f, 0, 14) === '_ca_attribute_' && preg_match('!^_ca_attribute_([A-Za-z]+[A-Za-z0-9_]*)$!', $vs_f, $va_matches)) {
$vn_element_id = $t_subject->_getElementID($va_matches[1]);
unset($va_fields_to_index[$vs_f]);
$va_fields_to_index['_ca_attribute_' . $vn_element_id] = $va_info;
}
}
}
// always index type id if applicable and not already indexed
if (method_exists($t_subject, 'getTypeFieldName') && ($vs_type_field = $t_subject->getTypeFieldName()) && !isset($va_fields_to_index[$vs_type_field])) {
$va_fields_to_index[$vs_type_field] = array('STORE', 'DONT_TOKENIZE');
}
return SearchBase::$s_fields_to_index_cache[$pm_subject_table . '/' . $pm_content_table . '/' . $vs_key] = SearchBase::$s_fields_to_index_cache[$vs_subject_table . '/' . $vs_content_table . '/' . $vs_key] = $va_fields_to_index;
}
示例2: getLabels
/**
* Returns labels associated with this row. By default all labels - preferred and non-preferred, and from all locales -
* are returned. You can limit the returned labels to specified locales by passing a list of locale_ids (numeric ids, *not* locale codes)
* in $pn_locale_ids. Similarly you can limit return labels to preferred on non-preferred by setting $pn_mode to __CA_LABEL_TYPE_PREFERRED__
* or __CA_LABEL_TYPE_NONPREFERRED__
*
* getLabels() returns an associated array keyed by the primary key of the item the label is attached to; each value is an array keyed by locale_id, the values of which
* is a list of associative arrays with the label table data. This return format is designed to be digested by the displayHelper function caExtractValuesByUserLocale()
*
* @param array $pa_locale_ids
* @param int $pn_mode
* @param boolean $pb_dont_cache
* @param array $pa_options Array of options. Supported options are:
* row_id = The row_id to return labels for. If omitted the id of the currently loaded row is used. If row_id is not set and now row is loaded then getLabels() will return null.
* restrict_to_types = an optional array of numeric type ids or alphanumeric type identifiers to restrict the returned labels to. The types are list items in a list specified in app.conf (or, if not defined there, by hardcoded constants in the model)
* restrictToTypes = synonym for restrict_to_types
* extractValuesByUserLocale = if set returned array of values is filtered to include only values appropriate for the current user's locale
* forDisplay = if true, a simple list of labels ready for display is returned; implies the extractValuesByUserLocale option
*
* @return array List of labels
*/
public function getLabels($pa_locale_ids = null, $pn_mode = __CA_LABEL_TYPE_ANY__, $pb_dont_cache = true, $pa_options = null)
{
if (isset($pa_options['restrictToTypes']) && (!isset($pa_options['restrict_to_types']) || !$pa_options['restrict_to_types'])) {
$pa_options['restrict_to_types'] = $pa_options['restrictToTypes'];
}
if (!($vn_id = $this->getPrimaryKey()) && !(isset($pa_options['row_id']) && ($vn_id = $pa_options['row_id']))) {
return null;
}
if (isset($pa_options['forDisplay']) && $pa_options['forDisplay']) {
$pa_options['extractValuesByUserLocale'] = true;
}
if ($pn_mode == __CA_LABEL_TYPE_ANY__ && caGetBundleAccessLevel($this->tableName(), 'preferred_labels') == __CA_BUNDLE_ACCESS_NONE__) {
$pn_mode = __CA_LABEL_TYPE_NONPREFERRED__;
}
if ($pn_mode == __CA_LABEL_TYPE_ANY__ && caGetBundleAccessLevel($this->tableName(), 'nonpreferred_labels') == __CA_BUNDLE_ACCESS_NONE__) {
$pn_mode = __CA_LABEL_TYPE_PREFERRED__;
}
if ($pn_mode == __CA_LABEL_TYPE_PREFERRED__ && caGetBundleAccessLevel($this->tableName(), 'preferred_labels') == __CA_BUNDLE_ACCESS_NONE__) {
return null;
}
if ($pn_mode == __CA_LABEL_TYPE_NONPREFERRED__ && caGetBundleAccessLevel($this->tableName(), 'nonpreferred_labels') == __CA_BUNDLE_ACCESS_NONE__) {
return null;
}
if (!is_array($pa_options)) {
$pa_options = array();
}
$vs_cache_key = caMakeCacheKeyFromOptions(array_merge($pa_options, array('table_name' => $this->tableName(), 'id' => $vn_id, 'mode' => (int) $pn_mode)));
if (!$pb_dont_cache && is_array($va_tmp = LabelableBaseModelWithAttributes::$s_label_cache[$this->tableName()][$vn_id][$vs_cache_key])) {
return $va_tmp;
}
if (!($t_label = $this->_DATAMODEL->getInstanceByTableName($this->getLabelTableName(), true))) {
return null;
}
if ($this->inTransaction()) {
$o_trans = $this->getTransaction();
$t_label->setTransaction($o_trans);
}
$vs_label_where_sql = 'WHERE (l.' . $this->primaryKey() . ' = ?)';
$vs_locale_join_sql = '';
if ($pa_locale_ids) {
$vs_label_where_sql .= ' AND (l.locale_id IN (' . join(',', $pa_locale_ids) . '))';
}
$vs_locale_join_sql = 'INNER JOIN ca_locales AS loc ON loc.locale_id = l.locale_id';
$vs_list_code = null;
if ($t_label->hasField('is_preferred')) {
switch ($pn_mode) {
case __CA_LABEL_TYPE_PREFERRED__:
$vs_list_code = $this->_CONFIG->get($this->tableName() . '_preferred_label_type_list');
$vs_label_where_sql .= ' AND (l.is_preferred = 1)';
break;
case __CA_LABEL_TYPE_NONPREFERRED__:
$vs_list_code = $this->_CONFIG->get($this->tableName() . '_nonpreferred_label_type_list');
$vs_label_where_sql .= ' AND (l.is_preferred = 0)';
break;
default:
$vs_list_code = $this->_CONFIG->get($this->tableName() . '_preferred_label_type_list');
break;
}
if (!$vs_list_code) {
if ($t_label_instance = $this->getLabelTableInstance()) {
$vs_list_code = $t_label_instance->getFieldInfo('type_id', 'LIST_CODE');
}
}
}
// limit related items to a specific type
$vs_restrict_to_type_sql = '';
if (isset($pa_options['restrict_to_type']) && $pa_options['restrict_to_type']) {
if (!isset($pa_options['restrict_to_types']) || !is_array($pa_options['restrict_to_types'])) {
$pa_options['restrict_to_types'] = array();
}
$pa_options['restrict_to_types'][] = $pa_options['restrict_to_type'];
}
if (isset($pa_options['restrict_to_types']) && $pa_options['restrict_to_types'] && is_array($pa_options['restrict_to_types']) && $vs_list_code) {
$t_list = new ca_lists();
$t_list_item = new ca_list_items();
$va_ids = array();
foreach ($pa_options['restrict_to_types'] as $vs_type) {
if (!($vn_restrict_to_type_id = (int) $t_list->getItemIDFromList($vs_list_code, $vs_type))) {
$vn_restrict_to_type_id = (int) $vs_type;
//.........这里部分代码省略.........
示例3: getScreens
/**
* Returns list of screens for a given UI.
*
* @param RequestHTTP $po_request The current request
* @param int $pn_type_id Optional type to restrict screens to
* @param array $pa_options Options include:
* showAll = Include screens that do not have placements. Default is false.
*
* @return array List of screens for this user interface
*/
public function getScreens($po_request = null, $pn_type_id = null, $pa_options = null)
{
if (!$this->getPrimaryKey()) {
return false;
}
$vs_opts_md5 = caMakeCacheKeyFromOptions($pa_options);
if (!($t_instance = $this->_DATAMODEL->getInstanceByTableNum($this->get('editor_type')))) {
return null;
}
if ($t_instance instanceof BaseRelationshipModel) {
$va_types = $t_instance->getRelationshipTypes();
} else {
$va_types = $t_instance->getTypeList();
}
$o_db = $this->getDb();
$va_type_list = caMakeTypeIDList($this->get('editor_type'), array($pn_type_id), array('dontIncludeSubtypesInTypeRestriction' => true));
if (!sizeof($va_type_list)) {
$va_type_list = array($pn_type_id);
}
$vs_type_sql = (int) $pn_type_id ? "AND (ceustr.type_id IS NULL OR ceustr.type_id IN (" . join(",", $va_type_list) . "))" : '';
$qr_res = $o_db->query("\n\t\t\tSELECT ceus.*, ceusl.*, ceustr.type_id restriction_type_id\n\t\t\tFROM ca_editor_ui_screens ceus\n\t\t\tINNER JOIN ca_editor_ui_screen_labels AS ceusl ON ceus.screen_id = ceusl.screen_id\n\t\t\tLEFT JOIN ca_editor_ui_screen_type_restrictions AS ceustr ON ceus.screen_id = ceustr.screen_id\n\t\t\tWHERE\n\t\t\t\t(ceus.ui_id = ?) {$vs_type_sql}\n\t\t\tORDER BY \n\t\t\t\tceus.rank, ceus.screen_id\n\t\t", (int) $this->getPrimaryKey());
$va_screens = array();
while ($qr_res->nextRow()) {
if (!$va_screens[$vn_screen_id = $qr_res->get('screen_id')][$vn_screen_locale_id = $qr_res->get('locale_id')]) {
$va_screens[$vn_screen_id][$vn_screen_locale_id] = $qr_res->getRow();
if ((bool) $va_screens[$vn_screen_id][$vn_screen_locale_id]['is_default']) {
$va_screens[$vn_screen_id][$vn_screen_locale_id]['isDefault'] = "◉";
}
$va_screens[$vn_screen_id][$vn_screen_locale_id]['numPlacements'] = sizeof($this->getScreenBundlePlacements($vn_screen_id));
}
if ($qr_res->get('restriction_type_id')) {
$vs_key_to_add = $t_instance instanceof BaseRelationshipModel ? 'type_code' : 'name_plural';
$va_screens[$vn_screen_id][$vn_screen_locale_id]['typeRestrictions'][$qr_res->get('restriction_type_id')] = $va_types[$qr_res->get('restriction_type_id')][$vs_key_to_add];
}
}
$va_screens_with_bundles = null;
if ((!isset($pa_options['showAll']) || !$pa_options['showAll']) && sizeof($va_screens)) {
// Get placements for all screens, so we can filter screens without placements
$qr_res = $o_db->query("\n\t\t\t\tSELECT screen_id, placement_id, bundle_name\n\t\t\t\tFROM ca_editor_ui_bundle_placements\n\t\t\t\tWHERE\n\t\t\t\t\tscreen_id IN (?)\n\t\t\t", array(array_keys($va_screens)));
$vs_table = $t_instance->tableName();
$va_screens_with_bundles = array();
while ($qr_res->nextRow()) {
$vn_screen_id = $qr_res->get('screen_id');
if (isset($va_screens_with_bundles[$vn_screen_id])) {
continue;
}
if (caGetBundleAccessLevel($vs_table, $qr_res->get('bundle_name')) != __CA_BUNDLE_ACCESS_NONE__) {
$va_screens_with_bundles[$vn_screen_id] = true;
}
}
}
foreach ($va_screens as $vn_screen_id => $va_screen_labels_by_locale) {
if (is_array($va_screens_with_bundles) && !isset($va_screens_with_bundles[$vn_screen_id])) {
unset($va_screens[$vn_screen_id]);
continue;
}
foreach ($va_screen_labels_by_locale as $vn_locale_id => $va_restriction_info) {
if (!is_array($va_screens[$vn_screen_id][$vn_locale_id]['typeRestrictions'])) {
continue;
}
$va_screens[$vn_screen_id][$vn_locale_id]['typeRestrictionsForDisplay'] = join(', ', $va_screens[$vn_screen_id][$vn_locale_id]['typeRestrictions']);
}
}
return caExtractValuesByUserLocale($va_screens);
}
示例4: _convertSourceCodesToIDs
/**
*
*
* @param array $pa_source_codes_or_ids List of source codes or ids
* @param array $pa_options Options include
* includeSubsources = include any child sources in the restriction. Default is true.
* @return array List of source_ids
*/
private function _convertSourceCodesToIDs($pa_source_codes_or_ids, $pa_options = null)
{
$vs_md5 = caMakeCacheKeyFromOptions($pa_source_codes_or_ids);
if (isset(BrowseEngine::$s_source_id_cache[$vs_md5])) {
return BrowseEngine::$s_source_id_cache[$vs_md5];
}
if (isset($pa_options['instance']) && is_object($pa_options['instance'])) {
$t_instance = $pa_options['instance'];
} else {
$t_instance = $this->getSubjectInstance();
}
$va_source_ids = array();
if (!$pa_source_codes_or_ids) {
return false;
}
if (is_array($pa_source_codes_or_ids) && !sizeof($pa_source_codes_or_ids)) {
return false;
}
if (!is_array($pa_source_codes_or_ids)) {
$pa_source_codes_or_ids = array($pa_source_codes_or_ids);
}
$t_list = new ca_lists();
if (!method_exists($t_instance, 'getSourceListCode')) {
return false;
}
if (!($vs_list_name = $t_instance->getSourceListCode())) {
return false;
}
$va_source_list = $t_instance->getSourceList();
foreach ($pa_source_codes_or_ids as $vs_code_or_id) {
if (!trim($vs_code_or_id)) {
continue;
}
if (!is_numeric($vs_code_or_id)) {
$vn_source_id = $t_list->getItemIDFromList($vs_list_name, $vs_code_or_id);
} else {
$vn_source_id = (int) $vs_code_or_id;
}
if (!$vn_source_id) {
return false;
}
if (isset($va_source_list[$vn_source_id]) && $va_source_list[$vn_source_id]) {
// is valid source for this subject
// See if there are any child sources
if (caGetOption('includeSubsources', $pa_options, true) && $this->opb_dont_expand_source_restrictions) {
$t_item = new ca_list_items($vn_source_id);
$va_ids = $t_item->getHierarchyChildren(null, array('idsOnly' => true));
}
$va_ids[] = $vn_source_id;
$va_source_ids = array_merge($va_source_ids, $va_ids);
}
}
$va_source_ids = array_keys(array_flip($va_source_ids));
BrowseEngine::$s_source_id_cache[$vs_md5] = $va_source_ids;
return $va_source_ids;
}
示例5: _get
//.........这里部分代码省略.........
}
$va_hier_list = array();
foreach ($va_ids as $vn_id) {
if (!is_array(SearchResult::$opa_hierarchy_siblings_prefetch_cache[$va_path_components['table_name']][$vn_id]) || !sizeof(SearchResult::$opa_hierarchy_siblings_prefetch_cache[$va_path_components['table_name']][$vn_id])) {
continue;
}
$qr_hier = $t_instance->makeSearchResult($va_path_components['table_name'], SearchResult::$opa_hierarchy_siblings_prefetch_cache[$va_path_components['table_name']][$vn_id]);
$va_tmp = array($va_path_components['table_name']);
if ($va_path_components['field_name']) {
$va_tmp[] = $va_path_components['field_name'];
}
if ($va_path_components['subfield_name']) {
$va_tmp[] = $va_path_components['subfield_name'];
}
$vs_hier_fld_name = join(".", $va_tmp);
$vs_pk = $t_instance->primaryKey();
while ($qr_hier->nextHit()) {
$vm_val = $qr_hier->get($vs_hier_fld_name, $pa_options);
$va_hier_list[$qr_hier->get($va_path_components['table_name'] . '.' . $vs_pk)] = $vb_return_as_array ? array_shift($vm_val) : $vm_val;
}
}
if (!$vb_return_as_array) {
return join($vs_delimiter, $va_hier_list);
}
return $va_hier_list;
break;
}
return;
}
if ($va_path_components['related']) {
//
// [RELATED TABLE]
//
$vs_opt_md5 = caMakeCacheKeyFromOptions(array_merge($pa_options, array('dontReturnLabels' => false)));
if (!isset(self::$s_rel_prefetch_cache[$this->ops_table_name][$vn_row_id][$va_path_components['table_name']][$vs_opt_md5])) {
$this->prefetchRelated($va_path_components['table_name'], $this->opo_engine_result->currentRow(), $this->getOption('prefetch'), array_merge($pa_options, array('dontReturnLabels' => false)));
}
$va_related_items = self::$s_rel_prefetch_cache[$this->ops_table_name][$vn_row_id][$va_path_components['table_name']][$vs_opt_md5];
if (!is_array($va_related_items)) {
return $vb_return_with_structure || $vb_return_as_array ? array() : null;
}
return $this->_getRelatedValue($va_related_items, $va_val_opts);
} else {
if (!$va_path_components['hierarchical_modifier']) {
//
// [PRIMARY TABLE] Created on
//
if ($va_path_components['field_name'] == 'created') {
if (!isset(self::$s_timestamp_cache['created_on'][$this->ops_table_name][$vn_row_id])) {
$this->prefetchChangeLogData($this->ops_table_name, $this->opo_engine_result->currentRow(), $this->getOption('prefetch'));
}
if ($vb_return_as_array) {
return self::$s_timestamp_cache['created_on'][$this->ops_table_name][$vn_row_id];
} else {
$vs_subfield = $va_path_components['subfield_name'] ? $va_path_components['subfield_name'] : 'timestamp';
$vm_val = self::$s_timestamp_cache['created_on'][$this->ops_table_name][$vn_row_id][$vs_subfield];
if ($vs_subfield == 'timestamp') {
$this->opo_tep->init();
$this->opo_tep->setUnixTimestamps($vm_val, $vm_val);
$vm_val = $this->opo_tep->getText($pa_options);
}
return $vm_val;
}
}
//
// [PRIMARY TABLE] Last modified on
示例6: caGetPrintTemplateDetails
/**
* @param $ps_type
* @param $ps_template
* @param null $pa_options
* @return array|bool|false|mixed
*/
function caGetPrintTemplateDetails($ps_type, $ps_template, $pa_options = null)
{
$vs_template_path = caGetPrintTemplateDirectoryPath($ps_type);
if (file_exists("{$vs_template_path}/local/{$ps_template}.php")) {
$vs_template_path = "{$vs_template_path}/local/{$ps_template}.php";
} elseif (file_exists("{$vs_template_path}/{$ps_template}.php")) {
$vs_template_path = "{$vs_template_path}/{$ps_template}.php";
} else {
return false;
}
$vs_cache_key = caMakeCacheKeyFromOptions($pa_options, $ps_type . '/' . $vs_template_path);
if (ExternalCache::contains($vs_cache_key, 'PrintTemplateDetails')) {
$va_list = ExternalCache::fetch($vs_cache_key, 'PrintTemplateDetails');
if (ExternalCache::fetch("{$vs_cache_key}_mtime", 'PrintTemplateDetails') >= filemtime($vs_template_path)) {
//Debug::msg('[caGetPrintTemplateDetails] cache hit');
return $va_list;
}
}
//Debug::msg('[caGetPrintTemplateDetails] cache miss');
$vs_template = file_get_contents($vs_template_path);
$va_info = array();
foreach (array("@name", "@type", "@pageSize", "@pageOrientation", "@tables", "@marginLeft", "@marginRight", "@marginTop", "@marginBottom", "@horizontalGutter", "@verticalGutter", "@labelWidth", "@labelHeight", "@elementCode") as $vs_tag) {
if (preg_match("!{$vs_tag}([^\n\n]+)!", $vs_template, $va_matches)) {
$va_info[str_replace("@", "", $vs_tag)] = trim($va_matches[1]);
} else {
$va_info[str_replace("@", "", $vs_tag)] = null;
}
}
$va_info['tables'] = preg_split("![,;]{1}!", $va_info['tables']);
$va_info['path'] = $vs_template_path;
ExternalCache::save($vs_cache_key, $va_info, 'PrintTemplateDetails');
ExternalCache::save("{$vs_cache_key}_mtime", filemtime($vs_template_path), 'PrintTemplateDetails');
return $va_info;
}
示例7: getObjects
/**
* Returns a list of ca_object rows related to the currently loaded object lot.
*
* @param int $pn_lot_id Optional lot_id to get object list for; if null then the id of the currently loaded lot will be used
* @param array $pa_options Options include:
* return = Set to "components" to return the count of component objects only; "objects" to return the count of objects (but not components) or "all" to return a count of any kind of object. [Default = "all"]
* @return array List of objects related to the object lot or null if $pn_lot_id is not set and there is no currently loaded lot
*/
public function getObjects($pn_lot_id = null, $pa_options = null)
{
$vn_lot_id = $this->getPrimaryKey();
if ($pn_lot_id && $pn_lot_id != $vn_lot_id) {
$vn_lot_id = $pn_lot_id;
}
$ps_return = caGetOption('return', $pa_options, 'all');
$vs_cache_key = caMakeCacheKeyFromOptions($pa_options);
if (is_array($va_component_types = $this->getAppConfig()->getList('ca_objects_component_types')) && sizeof($va_component_types)) {
$va_component_types = caMakeTypeIDList('ca_objects', $va_component_types);
}
$o_db = $this->getDb();
$qr_res = $o_db->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM ca_objects\n\t\t\t\tWHERE\n\t\t\t\t\tlot_id = ? AND deleted = 0\n\t\t\t\tORDER BY\n\t\t\t\t\tidno_sort\n\t\t\t", (int) $vn_lot_id);
$va_rows = array();
while ($qr_res->nextRow()) {
$va_rows[$qr_res->get('object_id')] = 1;
}
if (!sizeof($va_rows)) {
ca_object_lots::$s_object_count_cache[$vn_lot_id][$vs_cache_key] = 0;
return array();
}
$qr_res = $o_db->query("\n\t\t\tSELECT *\n\t\t\tFROM ca_objects\n\t\t\tWHERE\n\t\t\t\thier_object_id IN (?) AND deleted = 0\n\t\t\tORDER BY\n\t\t\t\tidno_sort\n\t\t", array(array_keys($va_rows)));
$va_objects = array();
while ($qr_res->nextRow()) {
$va_row = $qr_res->getRow();
if ($ps_return == 'objects' && in_array($va_row['type_id'], $va_component_types)) {
continue;
}
if ($ps_return == 'components' && !in_array($va_row['type_id'], $va_component_types)) {
continue;
}
$va_objects[$va_row['object_id']] = $va_row;
}
ca_object_lots::$s_object_count_cache[$vn_lot_id][$vs_cache_key] = sizeof($va_objects);
return $va_objects;
}
示例8: _genHierarchicalPath
/**
* Generate hierarchical values for using in indexing of hierarchical values with INDEX_ANCESTORS enabled
*/
private function _genHierarchicalPath($pn_subject_row_id, $ps_field, $t_subject, $pa_options = null)
{
$vs_key = caMakeCacheKeyFromOptions($pa_options, "{$pn_subject_row_id}/{$ps_field}");
if (MemoryCache::contains($vs_key, 'SearchIndexerHierPaths')) {
return MemoryCache::fetch($vs_key, 'SearchIndexerHierPaths');
}
$pn_start = caGetOption('INDEX_ANCESTORS_START_AT_LEVEL', $pa_options, 0);
$pn_max_levels = caGetOption('INDEX_ANCESTORS_MAX_NUMBER_OF_LEVELS', $pa_options, null);
$ps_delimiter = caGetOption('INDEX_ANCESTORS_AS_PATH_WITH_DELIMITER', $pa_options, '; ');
// Automagically generate hierarchical paths for preferred labels passed as label table + label field
if (is_subclass_of($t_subject, "BaseLabel")) {
if (!($t_subject->getPrimaryKey() == $pn_subject_row_id)) {
$t_subject->load($pn_subject_row_id);
}
$pn_subject_row_id = $t_subject->get($t_subject->getSubjectKey());
$t_subject = $t_subject->getSubjectTableInstance();
$ps_field = "preferred_labels.{$ps_field}";
}
$va_ids = $t_subject->getHierarchyAncestors($pn_subject_row_id, array('idsOnly' => true, 'includeSelf' => true));
$vs_subject_tablename = $t_subject->tableName();
if (is_array($va_ids) && sizeof($va_ids) > 0) {
$qr_hier_res = $t_subject->makeSearchResult($vs_subject_tablename, $va_ids, array('db' => $this->getDb()));
$va_hier_values = array();
while ($qr_hier_res->nextHit()) {
if ($vs_v = $qr_hier_res->get($vs_subject_tablename . "." . $ps_field)) {
$va_hier_values[] = $vs_v;
}
}
$va_hier_values = array_reverse($va_hier_values);
if ($pn_start > 0) {
$va_hier_values = array_slice($va_hier_values, $pn_start);
}
if ($pn_max_levels > 0) {
$va_hier_values = array_slice($va_hier_values, 0, $pn_max_levels);
}
if (MemoryCache::itemCountForNamespace('SearchIndexerHierPaths') > 100) {
MemoryCache::flush('SearchIndexerHierPaths');
}
$va_return = array('values' => $va_hier_values, 'path' => join($ps_delimiter, $va_hier_values));
MemoryCache::save($vs_key, $va_return, 'SearchIndexerHierPaths');
return $va_return;
}
MemoryCache::save($vs_key, null, 'SearchIndexerHierPaths');
return null;
}
示例9: getConfigurationForCurrentLocationType
/**
* Fetches configuration for the specified location class/subclass
*
* @param mixed $pm_current_loc_class Table name or number (aka. class)
* @param mixed $pm_current_loc_subclass Type_id or code (aka. subclass)
*
* @return array
*/
public static function getConfigurationForCurrentLocationType($pm_current_loc_class, $pm_current_loc_subclass = null, $pa_options = null)
{
$vs_cache_key = caMakeCacheKeyFromOptions($pa_options, "{$pm_current_loc_class}/{$pm_current_loc_subclass}");
if (isset(ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key])) {
return ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key];
}
$o_config = Configuration::load();
$o_dm = Datamodel::load();
$va_map = $o_config->getAssoc('current_location_criteria');
if (!($t_instance = $o_dm->getInstance($pm_current_loc_class, true))) {
return ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key] = null;
}
$vs_table_name = $t_instance->tableName();
if (isset($va_map[$vs_table_name])) {
if (!$pm_current_loc_subclass && isset($va_map[$vs_table_name]['*'])) {
return ca_objects::$s_current_location_type_configuration_cache[caMakeCacheKeyFromOptions($pa_options, "{$vs_table_name}/{$pm_type_id}")] = ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key] = $va_map[$vs_table_name]['*'];
}
// return default config if no type is specified
if ($pm_current_loc_subclass) {
switch ($vs_table_name) {
case 'ca_storage_locations':
$va_types = ca_relationship_types::relationshipTypeIDsToTypeCodes(array($pm_current_loc_subclass));
$vs_type = array_shift($va_types);
break;
default:
$vs_type = $t_instance->getTypeCode($pm_current_loc_subclass);
break;
}
$va_facet_display_config = caGetOption('facet', $pa_options, null);
if ($vs_type && isset($va_map[$vs_table_name][$vs_type])) {
if (is_array($va_facet_display_config) && isset($va_facet_display_config[$vs_table_name][$vs_type])) {
$va_map[$vs_table_name][$vs_type] = array_merge($va_map[$vs_table_name][$vs_type], $va_facet_display_config[$vs_table_name][$vs_type]);
}
return ca_objects::$s_current_location_type_configuration_cache[caMakeCacheKeyFromOptions($pa_options, "{$vs_table_name}/{$pm_current_loc_subclass}")] = ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key] = $va_map[$vs_table_name][$vs_type];
} elseif (isset($va_map[$vs_table_name]['*'])) {
if (is_array($va_facet_display_config) && isset($va_facet_display_config[$vs_table_name]['*'])) {
$va_map[$vs_table_name][$vs_type] = array_merge($va_map[$vs_table_name]['*'], $va_facet_display_config[$vs_table_name]['*']);
}
return ca_objects::$s_current_location_type_configuration_cache[caMakeCacheKeyFromOptions($pa_options, "{$vs_table_name}/{$pm_current_loc_subclass}")] = ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key] = $va_map[$vs_table_name]['*'];
}
}
}
return ca_objects::$s_current_location_type_configuration_cache[caMakeCacheKeyFromOptions($pa_options, "{$vs_table_name}/{$pm_current_loc_subclass}")] = ca_objects::$s_current_location_type_configuration_cache[$vs_cache_key] = null;
}
示例10: getItemsForList
/**
* Returns items contained in list, including their labels. This method will returned the list items sorted according to the default_sort field setting of
* the list they belong to. Note that correct order when sorting by label is only guaranteed if 'extractValuesByUserLocale' is set to true [default is false].
* This is due to the list return format: since each item is indexed by item_id first, it can only have a single position in the return structure. If multiple labels are returned
* for an item then the item will only be in the correct sort order for one of the labels in most cases. To ensure proper sort order by label text, labels must be restricted to a
* single locale.
*
* @param $pm_list_name_or_id mixed - list_code or list_id of desired list
* @param $pa_options array - optional array of options. Supported options include:
* returnHierarchyLevels = if true list is returned with 'LEVEL' field set to hierarchical level of item, and items are returned in order such that if you loop through the returned list and indent each item according to its level you get a nicely formatted hierarchical display. Default is false.
* extractValuesByUserLocale = if true then values are processed to be appropriate for current user locale; default is false: return values for all locales
* directChildrenOnly = if true, only children immediately below the specified item are returned; [default is false]
* includeSelf = if true, the specified item is included in the returned set of items; [default is false]
* type_id = optional list item type to limit returned items by; default is to not limit by type (eg. type_id = null)
* item_id = optional item_id to use as root of hierarchy for returned items; if this is not set (the default) then all items in the list are returned
* sort = if set to a __CA_LISTS_SORT_BY_*__ constant, will force the list to be sorted by that criteria overriding the sort order set in the ca_lists.default_sort field
* idsOnly = if true, only the primary key id values of the list items are returned
* enabledOnly = return only enabled list items [default=false]
* labelsOnly = if true only labels in the current locale are returns in an array key'ed on item_id
*
* @return array List of items indexed first on item_id and then on locale_id of label
*/
public function getItemsForList($pm_list_name_or_id, $pa_options = null)
{
$vn_list_id = $this->_getListID($pm_list_name_or_id);
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!isset($pa_options['returnHierarchyLevels'])) {
$pa_options['returnHierarchyLevels'] = false;
}
if (isset($pa_options['directChildrenOnly']) && $pa_options['directChildrenOnly']) {
$pa_options['returnHierarchyLevels'] = false;
}
$vb_enabled_only = caGetOption('enabledOnly', $pa_options, false);
$vb_labels_only = false;
if (isset($pa_options['labelsOnly']) && $pa_options['labelsOnly']) {
$pa_options['extractValuesByUserLocale'] = true;
$pa_options['returnHierarchyLevels'] = false;
$vb_labels_only = true;
}
$vs_cache_key = caMakeCacheKeyFromOptions(array_merge($pa_options, array('list_id' => $vn_list_id)));
if (is_array(ca_lists::$s_list_item_cache[$vs_cache_key])) {
return ca_lists::$s_list_item_cache[$vs_cache_key];
}
$t_list = new ca_lists($vn_list_id);
$pn_type_id = isset($pa_options['type_id']) ? (int) $pa_options['type_id'] : null;
$pn_sort = isset($pa_options['sort']) ? (int) $pa_options['sort'] : $t_list->get('default_sort');
if (!($pn_item_id = isset($pa_options['item_id']) ? (int) $pa_options['item_id'] : null)) {
$pn_item_id = $t_list->getRootListItemID($vn_list_id);
}
$t_list_item = new ca_list_items($pn_item_id);
if (!$t_list_item->getPrimaryKey() || $t_list_item->get('list_id') != $vn_list_id) {
return null;
}
$vs_hier_sql = '';
if ($t_list_item->getPrimaryKey()) {
$vs_hier_sql = " AND ((cli.hier_left >= " . floatval($t_list_item->get('hier_left')) . ") AND (cli.hier_right <= " . floatval($t_list_item->get('hier_right')) . "))";
}
if (!isset($pa_options['returnHierarchyLevels']) || !$pa_options['returnHierarchyLevels']) {
$vs_type_sql = '';
if ($pn_type_id) {
$vs_type_sql = ' AND (cli.type_id = ' . intval($pn_type_id) . ')';
}
$vs_order_by = '';
switch ($pn_sort) {
case __CA_LISTS_SORT_BY_LABEL__:
// by label
$vs_order_by = 'clil.name_plural';
break;
case __CA_LISTS_SORT_BY_RANK__:
// by rank
$vs_order_by = 'cli.rank';
break;
case __CA_LISTS_SORT_BY_VALUE__:
// by value
$vs_order_by = 'cli.item_value';
break;
case __CA_LISTS_SORT_BY_IDENTIFIER__:
// by identifier
$vs_order_by = 'cli.idno_sort';
break;
}
if ($vs_order_by) {
$vs_order_by = "ORDER BY {$vs_order_by}";
}
$vs_enabled_sql = '';
if ($vb_enabled_only) {
$vs_enabled_sql = ' AND (cli.is_enabled = 1)';
}
$vs_direct_children_sql = '';
if (isset($pa_options['directChildrenOnly']) && $pa_options['directChildrenOnly']) {
$vs_direct_children_sql = " AND cli.parent_id = " . (int) $pn_item_id;
}
$o_db = $this->getDb();
$vs_sql = "\n\t\t\t\tSELECT clil.*, cli.*\n\t\t\t\tFROM ca_list_items cli\n\t\t\t\tINNER JOIN ca_list_item_labels AS clil ON clil.item_id = cli.item_id\n\t\t\t\tWHERE\n\t\t\t\t\t(cli.deleted = 0) AND (clil.is_preferred = 1) AND (cli.list_id = ?) {$vs_type_sql} {$vs_direct_children_sql} {$vs_hier_sql} {$vs_enabled_sql}\n\t\t\t\t{$vs_order_by}\n\t\t\t";
//print $vs_sql;
$qr_res = $o_db->query($vs_sql, (int) $vn_list_id);
$va_seen_locales = array();
$va_items = array();
//.........这里部分代码省略.........
示例11: _get
//.........这里部分代码省略.........
} else {
$vs_subfield = $va_path_components['subfield_name'] ? $va_path_components['subfield_name'] : 'timestamp';
$vm_val = $this->opa_timestamp_cache['last_changed'][$this->ops_table_name][$vn_row_id][$vs_subfield];
if ($vs_subfield == 'timestamp') {
$o_tep = new TimeExpressionParser();
$o_tep->setUnixTimestamps($vm_val, $vm_val);
$vm_val = $o_tep->getText($pa_options);
}
return $vm_val;
}
}
if (!($t_instance = $this->opo_datamodel->getInstanceByTableName($va_path_components['table_name'], true))) {
return null;
}
// Bad table
$t_original_instance = $t_instance;
// $t_original_instance will always be the as-called subject; optimizations may results in $t_instance being transformed into a different model
//
// Simple related table get:
// <table>
// <table>.related
// <table>.hierarchy
// <table>.related.hierarchy
//
if ($va_path_components['num_components'] == 1 && $va_path_components['table_name'] !== $this->ops_table_name || $va_path_components['num_components'] == 2 && $va_path_components['field_name'] == 'related' || $va_path_components['num_components'] == 2 && $va_path_components['field_name'] == 'hierarchy' || $va_path_components['num_components'] == 3 && $va_path_components['field_name'] == 'related' && $va_path_components['subfield_name'] == 'hierarchy') {
if (!($t_table = $this->opo_datamodel->getInstanceByTableName($this->ops_table_name, true))) {
return null;
}
$vb_show_hierarachy = (bool) ($va_path_components['field_name'] == 'hierarchy' && $t_instance->isHierarchical());
if ($va_path_components['num_components'] == 2) {
$va_path_components['num_components'] = 1;
$va_path_components['field_name'] = null;
}
$vs_opt_md5 = caMakeCacheKeyFromOptions($pa_options);
if (!isset($this->opa_rel_prefetch_cache[$va_path_components['table_name']][$vn_row_id][$vs_opt_md5])) {
$this->prefetchRelated($va_path_components['table_name'], $this->opo_engine_result->currentRow(), $this->getOption('prefetch'), $pa_options);
}
$va_related_items = $this->opa_rel_prefetch_cache[$va_path_components['table_name']][$vn_row_id][$vs_opt_md5];
if (!is_array($va_related_items)) {
return null;
}
if (is_array($va_sort_fields) && sizeof($va_sort_fields)) {
$va_related_items = caSortArrayByKeyInValue($va_related_items, $va_sort_fields);
}
// Return as array
if ($vs_template) {
return caProcessTemplateForIDs($vs_template, $this->opo_subject_instance->tableName(), array($vn_row_id), array_merge($pa_options, array('placeholderPrefix' => $va_path_components['field_name'])));
}
if ($vb_return_as_array || $vb_return_all_locales) {
if ($vb_return_all_locales) {
$va_related_tmp = array();
foreach ($va_related_items as $vn_i => $va_related_item) {
$va_related_tmp[$vn_i][$va_related_item['locale_id']] = $va_related_item;
}
return $va_related_tmp;
} else {
if (!$vs_template && !$va_path_components['field_name']) {
return $va_related_items;
}
$vs_pk = $t_instance->primaryKey();
$va_links = array();
foreach ($va_related_items as $vn_relation_id => $va_relation_info) {
$va_relation_info['labels'] = caExtractValuesByUserLocale(array(0 => $va_relation_info['labels']));
if ($vb_return_as_link) {
$va_template_opts = array();
$va_template_opts['relationshipValues'][$va_relation_info[$vs_pk]][$va_relation_info['relation_id']]['relationship_typename'] = $va_relation_info['relationship_typename'];
示例12: caGetPrintTemplateDetails
/**
*
*
* @return array
*/
function caGetPrintTemplateDetails($ps_type, $ps_template, $pa_options = null)
{
$vs_template_path = caGetPrintTemplateDirectoryPath($ps_type);
if (file_exists("{$vs_template_path}/local/{$ps_template}.php")) {
$vs_template_path = "{$vs_template_path}/local/{$ps_template}.php";
} elseif (file_exists("{$vs_template_path}/{$ps_template}.php")) {
$vs_template_path = "{$vs_template_path}/{$ps_template}.php";
} else {
return false;
}
if ($o_cache = caGetCacheObject('caPrintTemplatesList_' . $ps_type)) {
$vs_cache_key = caMakeCacheKeyFromOptions($pa_options, $ps_type . '/' . $vs_template_path);
if (($va_info = $o_cache->load($vs_cache_key)) && ($vn_mtime = $o_cache->load("{$vs_cache_key}_mtime")) >= filemtime($vs_template_path)) {
return $va_info;
}
}
$vs_template = file_get_contents($vs_template_path);
$va_info = array();
foreach (array("@name", "@type", "@pageSize", "@pageOrientation", "@tables", "@marginLeft", "@marginRight", "@marginTop", "@marginBottom", "@horizontalGutter", "@verticalGutter", "@labelWidth", "@labelHeight") as $vs_tag) {
if (preg_match("!{$vs_tag}([^\n\n]+)!", $vs_template, $va_matches)) {
$va_info[str_replace("@", "", $vs_tag)] = trim($va_matches[1]);
} else {
$va_info[str_replace("@", "", $vs_tag)] = null;
}
}
$va_info['tables'] = preg_split("![,;]{1}!", $va_info['tables']);
$va_info['path'] = $vs_template_path;
if ($o_cache) {
$o_cache->save($va_info, $vs_cache_key);
$o_cache->save(filemtime($vs_template_path), "{$vs_cache_key}_mtime");
}
return $va_info;
}
示例13: getObjectHistory
/**
* Return array with list of significant events in object life cycle as configured for
* a ca_objects_history editor bundle.
*
* @param array $pa_bundle_settings The settings for a ca_objects_history editing BUNDLES
* @param array $pa_options Array of options. Options include:
* noCache = Don't use any cached history data. [Default is false]
* currentOnly = Only return history entries dates before or on the current date. [Default is false]
* limit = Only return a maximum number of history entries. [Default is null; no limit]
*
* @return array A list of life cycle events, indexed by historic timestamp for date of occurrrence. Each list value is an array of history entries.
*
* @used-by ca_objects::getObjectHistoryHTMLFormBundle
*/
public function getObjectHistory($pa_bundle_settings = null, $pa_options = null)
{
global $g_ui_locale;
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_bundle_settings)) {
$pa_bundle_settings = array();
}
$vs_cache_key = caMakeCacheKeyFromOptions(array_merge($pa_bundle_settings, $pa_options, array('object_id' => $this->getPrimaryKey())));
$pb_no_cache = caGetOption('noCache', $pa_options, false);
if (!$pb_no_cache && isset(ca_objects::$s_object_use_cache[$vs_cache_key])) {
return ca_objects::$s_object_use_cache[$vs_cache_key];
}
$pb_display_label_only = caGetOption('displayLabelOnly', $pa_options, false);
$pb_get_current_only = caGetOption('currentOnly', $pa_options, false);
$pn_limit = caGetOption('limit', $pa_options, null);
$vs_display_template = caGetOption('display_template', $pa_bundle_settings, _t('No template defined'));
$vs_history_template = caGetOption('history_template', $pa_bundle_settings, $vs_display_template);
$vn_current_date = caDateToHistoricTimestamp(_t('now'));
$o_media_coder = new MediaInfoCoder();
//
// Get history
//
$va_history = array();
// Lots
if (is_array($va_lot_types = caGetOption('ca_object_lots_showTypes', $pa_bundle_settings, null)) && ($vn_lot_id = $this->get('lot_id'))) {
$t_lot = new ca_object_lots($vn_lot_id);
if (!$t_lot->get('deleted')) {
$va_lot_type_info = $t_lot->getTypeList();
$vn_type_id = $t_lot->get('type_id');
$vs_color = $va_lot_type_info[$vn_type_id]['color'];
if (!$vs_color || $vs_color == '000000') {
$vs_color = caGetOption("ca_object_lots_{$va_lot_type_info[$vn_type_id]['idno']}_color", $pa_bundle_settings, 'ffffff');
}
$va_dates = array();
$va_date_elements = caGetOption("ca_object_lots_{$va_lot_type_info[$vn_type_id]['idno']}_dateElement", $pa_bundle_settings, null);
if (!is_array($va_date_elements) && $va_date_elements) {
$va_date_elements = array($va_date_elements);
}
if (is_array($va_date_elements) && sizeof($va_date_elements)) {
foreach ($va_date_elements as $vs_date_element) {
$va_dates[] = array('sortable' => $t_lot->get($vs_date_element, array('getDirectDate' => true)), 'display' => $t_lot->get($vs_date_element));
}
}
if (!sizeof($va_dates)) {
$va_dates[] = array('sortable' => $vn_date = caUnixTimestampToHistoricTimestamps($t_lot->getCreationTimestamp(null, array('timestampOnly' => true))), 'display' => caGetLocalizedDate($vn_date));
}
foreach ($va_dates as $va_date) {
if (!$va_date['sortable']) {
continue;
}
if (!in_array($vn_type_id, $va_lot_types)) {
continue;
}
if ($pb_get_current_only && $va_date['sortable'] > $vn_current_date) {
continue;
}
$vs_default_display_template = '^ca_object_lots.preferred_labels.name (^ca_object_lots.idno_stub)';
$vs_display_template = $pb_display_label_only ? "" : caGetOption("ca_object_lots_{$va_lot_type_info[$vn_type_id]['idno']}_displayTemplate", $pa_bundle_settings, $vs_default_display_template);
$va_history[$va_date['sortable']][] = array('type' => 'ca_object_lots', 'id' => $vn_lot_id, 'display' => $t_lot->getWithTemplate($vs_display_template), 'color' => $vs_color, 'icon_url' => $vs_icon_url = $o_media_coder->getMediaTag($va_lot_type_info[$vn_type_id]['icon'], 'icon'), 'typename_singular' => $vs_typename = $va_lot_type_info[$vn_type_id]['name_singular'], 'typename_plural' => $va_lot_type_info[$vn_type_id]['name_plural'], 'icon' => '<div class="caUseHistoryIconContainer" style="background-color: #' . $vs_color . '"><div class="caUseHistoryIcon">' . ($vs_icon_url ? $vs_icon_url : '<div class="caUseHistoryIconText">' . $vs_typename . '</div>') . '</div></div>', 'date' => $va_date['display']);
}
}
}
// Loans
$va_loans = $this->get('ca_loans.loan_id', array('returnAsArray' => true));
if (is_array($va_loan_types = caGetOption('ca_loans_showTypes', $pa_bundle_settings, null)) && is_array($va_loans) && sizeof($va_loans)) {
$qr_loans = caMakeSearchResult('ca_loans', $va_loans);
$t_loan = new ca_loans();
$va_loan_type_info = $t_loan->getTypeList();
$va_date_elements_by_type = array();
foreach ($va_loan_types as $vn_type_id) {
if (!is_array($va_date_elements = caGetOption("ca_loans_{$va_loan_type_info[$vn_type_id]['idno']}_dateElement", $pa_bundle_settings, null)) && $va_date_elements) {
$va_date_elements = array($va_date_elements);
}
if (!$va_date_elements) {
continue;
}
$va_date_elements_by_type[$vn_type_id] = $va_date_elements;
}
while ($qr_loans->nextHit()) {
$vn_loan_id = $qr_loans->get('loan_id');
if ((string) $qr_loans->get('ca_loans.deleted') !== '0') {
continue;
}
// filter out deleted
//.........这里部分代码省略.........