当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_lists::itemIDsToIDNOs方法代码示例

本文整理汇总了PHP中ca_lists::itemIDsToIDNOs方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_lists::itemIDsToIDNOs方法的具体用法?PHP ca_lists::itemIDsToIDNOs怎么用?PHP ca_lists::itemIDsToIDNOs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca_lists的用法示例。


在下文中一共展示了ca_lists::itemIDsToIDNOs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEntry

 /**
  * Get a dictionary entry for a bundle. Entries are matched first on bundle name, and then filtered on any restrict_to_types
  * and restrict_to_relationship_types settings in the $pa_settings parameter. This allows you to have different dictionary entries
  * for the same bundle name subject to type restrictions set in the user interface. For example, if you have a ca_entities bundle (related
  * entities) you can have different dictionary entries return when ca_entities is restricted to authors vs. publishers.
  *
  * @param string $ps_bundle_name The bundle name to find a dictionary entry for. 
  * @param array $pa_settings Bundle settings to use when matching definitions. The bundle settings restrict_to_types and restrict_to_relationship_types will be used, when present, to find type-restricted dictionary entries.
  * @param array $pa_options Options include:
  *		noCache = Bypass cache (typically loaded using ca_metadata_dictionary_entries::preloadDefinitions()) and check entry directly. [Default=false]
  *
  * @return array An array with entry data. Keys are entry field names. The 'settings' key contains the label, definition text and any type restrictions. Returns null if no entry is defined.
  */
 public static function getEntry($ps_bundle_name, $pa_settings = null, $pa_options = null)
 {
     if (caGetOption('noCache', $pa_options, false)) {
         ca_metadata_dictionary_entries::preloadDefinitions(array($ps_bundle_name));
     }
     if (!is_array($va_types = caGetOption('restrict_to_types', $pa_settings, null)) && $va_types) {
         $va_types = array($va_types);
     }
     if (!is_array($va_types)) {
         $va_types = array();
     }
     if (sizeof($va_types = array_filter($va_types, 'strlen'))) {
         $va_types = ca_lists::itemIDsToIDNOs($va_types);
     }
     if (!is_array($va_relationship_types = caGetOption('restrict_to_relationship_types', $pa_settings, null)) && $va_relationship_types) {
         $va_relationship_types = array($va_relationship_types);
     }
     if (!is_array($va_relationship_types)) {
         $va_relationship_types = array();
     }
     if (sizeof($va_relationship_types = array_filter($va_relationship_types, 'strlen'))) {
         $va_relationship_types = ca_relationship_types::relationshipTypeIDsToTypeCodes($va_relationship_types);
     }
     if ($va_entry_list = ca_metadata_dictionary_entries::entryExists($ps_bundle_name)) {
         $vn_entry_id = null;
         if (sizeof($va_types) || sizeof($va_relationship_types)) {
             foreach (array_keys($va_entry_list) as $vn_id) {
                 $va_entry = ca_metadata_dictionary_entries::$s_definition_cache[$vn_id];
                 if (sizeof($va_relationship_types)) {
                     if (is_array($va_entry_types = $va_entry['settings']['restrict_to_relationship_types'])) {
                         if (sizeof(array_intersect($va_relationship_types, $va_entry_types))) {
                             $vn_entry_id = $vn_id;
                         } else {
                             $vn_entry_id = null;
                             continue;
                         }
                     }
                 }
                 if (sizeof($va_types)) {
                     if (is_array($va_entry_types = $va_entry['settings']['restrict_to_types'])) {
                         if (sizeof(array_intersect($va_types, $va_entry_types))) {
                             $vn_entry_id = $vn_id;
                         } else {
                             $vn_entry_id = null;
                             continue;
                         }
                     }
                 }
                 if ($vn_entry_id) {
                     break;
                 }
             }
         }
         if (!$vn_entry_id) {
             $vn_entry_id = array_pop(array_keys($va_entry_list));
         }
         return ca_metadata_dictionary_entries::$s_definition_cache[$vn_entry_id];
     }
     return null;
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:73,代码来源:ca_metadata_dictionary_entries.php


注:本文中的ca_lists::itemIDsToIDNOs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。