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


PHP EEM_Base::relation_settings方法代码示例

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


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

示例1: save

 /**
  * After this form has been initialized and is verified to be valid,
  * either creates a model object from its data and saves it, or updates
  * the model object its data represents
  * @throws EE_Error
  * @return int, 1 on a successful update, the ID of
  *                    the new entry on insert; 0 on failure
  */
 public function save()
 {
     if (!$this->_model_object) {
         throw new EE_Error(sprintf(__("Cannot save the model form's model object (model is '%s') because there is no model object set. You must either set it, or call receive_form_submission where it is set automatically", "event_espresso"), get_class($this->_model)));
     }
     $success = $this->_model_object->save();
     foreach ($this->_model->relation_settings() as $relation_name => $relation_obj) {
         if (isset($this->_subsections[$relation_name])) {
             $success = $this->_save_related_info($relation_name);
         }
     }
     return $success;
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:21,代码来源:EE_Model_Form_Section.form.php

示例2: relation_settings

 /**
  * Gets all the related models for the specified model. It's good to use this
  * in case this model didn't exist for this version or something
  * @param \EEM_Base $model
  * @return \EE_Model_Relation_Base[]
  */
 public function relation_settings(\EEM_Base $model)
 {
     $relations = array();
     foreach ($model->relation_settings() as $relation_name => $relation_obj) {
         if ($this->is_model_name_in_this_version($relation_name)) {
             $relations[$relation_name] = $relation_obj;
         }
     }
     //filter the results, but use the old filter name
     return apply_filters('FHEE__Read__create_entity_from_wpdb_result__related_models_to_include', $relations, $model);
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:17,代码来源:Model_Version_Info.php


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