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


PHP SugarBean::inOperation方法代码示例

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


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

示例1: checkRelatedName

 /**
  * @param ForecastWorksheet $bean
  * @param string $event
  * @param array $args
  * @return bool
  */
 public static function checkRelatedName($bean, $event, $args)
 {
     if ($event == 'before_save') {
         if (empty($bean->account_id) && !empty($bean->account_name)) {
             $bean->account_name = '';
         }
         if (empty($bean->opportunity_id) && !empty($bean->opportunity_name)) {
             $bean->opportunity_name = '';
         }
         // if we are in a delete operation, don't update the date modified
         if (isset($bean->fetched_row['date_modified']) && (SugarBean::inOperation('delete') || SugarBean::inOperation('saving_related'))) {
             $bean->date_modified = $bean->fetched_row['date_modified'];
         }
     }
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:22,代码来源:ForecastWorksheetHooks.php

示例2: createOrUpdate

 /**
  * Handler for create and update actions on a bean.
  *
  * @param SugarBean $bean
  * @param array     $args
  * @param Activity  $act
  * @return bool     eventProcessed
  */
 protected function createOrUpdate(SugarBean $bean, array $args, Activity $act)
 {
     if ($bean->deleted || $bean->inOperation('saving_related')) {
         return false;
     }
     // Add Appropriate Subscriptions for this Bean
     $this->addRecordSubscriptions($args, $bean);
     $data = array('object' => self::getBeanAttributes($bean));
     if ($args['isUpdate']) {
         $act->activity_type = 'update';
         $data['changes'] = $args['dataChanges'];
         $this->prepareChanges($bean, $data);
         //if no field changes to report, do not create the activity
         if (empty($data['changes'])) {
             return false;
         }
     } else {
         $act->activity_type = 'create';
     }
     $act->parent_id = $bean->id;
     $act->parent_type = $bean->module_name;
     $act->data = $data;
     $act->save();
     $act->processRecord($bean);
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:34,代码来源:ActivityQueueManager.php

示例3: getLinkField

 protected function getLinkField($fieldName)
 {
     if ((empty($this->context->{$fieldName}) || !is_a($this->context->{$fieldName}, "Link2")) && !$this->context->load_relationship($fieldName)) {
         throw new Exception("Unable to load relationship {$fieldName}");
     }
     if (empty($this->context->{$fieldName})) {
         throw new Exception("Relationship {$fieldName} was not set");
     }
     if (SugarBean::inOperation('delete')) {
         // if we are in a delete operation, always re-fetch the relationships beans
         // as one of the could have changed and we want the freshest set from the db
         $this->context->{$fieldName}->beans = null;
         $this->context->{$fieldName}->resetLoaded();
     } elseif (isset($this->context->{$fieldName}->beans)) {
         return $this->context->{$fieldName}->beans;
     }
     $beans = $this->context->{$fieldName}->getBeans();
     return $beans;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:SugarFieldExpression.php


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