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


PHP EEM_Base::wp_user_field_name方法代码示例

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


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

示例1: prepare_where_conditions_for_querying

 /**
  * Takes the default query parameters, and traverses them, adding the model relation chain
  * onto them (intelligently doesn't do that to logic query params like NOT, OR, and AND)
  * @param array $where_conditions
  * @param string $model_relation_chain
  * @return array
  * @throws \EE_Error
  */
 public function prepare_where_conditions_for_querying($where_conditions, $model_relation_chain)
 {
     $where_conditions_with_model_relation_chain_prefixes = array();
     if (!is_array($where_conditions)) {
         $where_conditions = array();
     }
     foreach ($where_conditions as $key => $value) {
         if (in_array($key, array('OR', 'AND', 'NOT')) || strpos($key, 'OR*') !== false || strpos($key, 'AND*') !== false || strpos($key, 'NOT*') !== false) {
             $where_conditions_with_model_relation_chain_prefixes[$key] = $this->prepare_where_conditions_for_querying($value, $model_relation_chain);
         } else {
             if ($model_relation_chain != '' && $model_relation_chain[strlen($model_relation_chain) - 1] != '.') {
                 $model_relation_chain = $model_relation_chain . ".";
             }
             //check for the current user id place holder, and if present change it
             if ($value === self::current_user_placeholder) {
                 $value = get_current_user_id();
             }
             //check for user field placeholder
             if ($key == self::user_field_name_placeholder) {
                 if (!$this->_model->wp_user_field_name()) {
                     throw new EE_Error(sprintf(__('There is no foreign key to the WP_User model on model %s. Please either modify your default where conditions, add a _model_chain_to_wp_user onto the model, or a proper EE_WP_User_Field onto the model', 'event_espresso'), $this->_model->get_this_model_name()));
                 }
                 $key = $this->_model->wp_user_field_name();
             }
             $where_conditions_with_model_relation_chain_prefixes[$model_relation_chain . $key] = $value;
         }
     }
     return $where_conditions_with_model_relation_chain_prefixes;
 }
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:37,代码来源:EE_Default_Where_Conditions.strategy.php


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