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


PHP SugarBean::retrieve方法代码示例

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


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

示例1: action_reschedule

 /**
  * Action Reschedule
  * Used for drag & drop
  */
 protected function action_reschedule()
 {
     $this->view = 'json';
     $commit = true;
     if (!$this->retrieveCurrentBean('Save')) {
         return;
     }
     $_REQUEST['parent_name'] = $this->currentBean->parent_name;
     $dateField = "date_start";
     if ($this->currentBean->module_dir == "Tasks") {
         $dateField = "date_due";
     }
     if (!empty($_REQUEST['calendar_style']) && $_REQUEST['calendar_style'] == "basic") {
         list($tmp, $time) = explode(" ", $this->currentBean->{$dateField});
         list($date, $tmp) = explode(" ", $_REQUEST['datetime']);
         $_REQUEST['datetime'] = $date . " " . $time;
     }
     $_POST[$dateField] = $_REQUEST['datetime'];
     if ($this->currentBean->module_dir == "Tasks" && !empty($this->currentBean->date_start)) {
         if ($GLOBALS['timedate']->fromUser($_POST['date_due'])->ts < $GLOBALS['timedate']->fromUser($this->currentBean->date_start)->ts) {
             $this->view_object_map['jsonData'] = array('access' => 'no', 'errorMessage' => $GLOBALS['mod_strings']['LBL_DATE_END_ERROR']);
             $commit = false;
         }
     }
     if ($commit) {
         require_once 'include/formbase.php';
         $this->currentBean = populateFromPost("", $this->currentBean);
         $this->currentBean->save();
         $this->currentBean->retrieve($_REQUEST['record']);
         $this->view_object_map['jsonData'] = CalendarUtils::get_sendback_array($this->currentBean);
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:36,代码来源:controller.php

示例2: retrieve

 function retrieve($id = -1, $encode = true, $deleted = true)
 {
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Step2') {
         $this->load_merge_bean($this->merge_bean, false, $id);
     } else {
         parent::retrieve($id, $encode, $deleted);
     }
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:8,代码来源:MergeRecord.php

示例3: retrieve

 function retrieve($id)
 {
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Step2') {
         $this->load_merge_bean($this->merge_bean, false, $id);
     } else {
         parent::retrieve($id);
     }
 }
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:8,代码来源:MergeRecord.php

示例4: retrieve

 function retrieve($id = -1)
 {
     $bean = parent::retrieve($id);
     if ($bean != null) {
         if (!SimpleTeams::checkAccess($bean)) {
             $bean = null;
         }
     }
     return $bean;
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:10,代码来源:RunnableReport.php

示例5: retrieve

 function retrieve($id = NULL, $encode = false)
 {
     $bean = parent::retrieve($id, $encode);
     if ($bean != null) {
         if (!SimpleTeams::checkAccess($bean)) {
             $bean = null;
         }
     }
     return $bean;
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:10,代码来源:ReportProviderBase.php

示例6: retrieve

 function retrieve($id = -1, $encode = true, $deleted = true)
 {
     parent::retrieve($id, $encode, $deleted);
     global $timedate;
     $date_start_array = explode(" ", trim($this->date_start));
     if (count($date_start_array) == 2) {
         $this->time_start = $date_start_array[1];
         $this->date_start = $date_start_array[0];
     }
     return $this;
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:11,代码来源:EmailMarketing.php

示例7: retrieve

 function retrieve($id)
 {
     parent::retrieve($id);
     global $timedate;
     $date_start_array = explode(" ", trim($this->date_start));
     if (count($date_start_array) == 2) {
         $this->time_start = $date_start_array[1];
         $this->date_start = $date_start_array[0];
     }
     return $this;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:11,代码来源:EmailMarketing.php

示例8: retrieve

 function retrieve($id = -1, $encode = true, $deleted = true)
 {
     return parent::retrieve($id, $encode, false);
     //ignore the deleted filter. the table does not have the deleted column in it.
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:5,代码来源:UpgradeHistory.php

示例9: retrieve

 function retrieve($id = -99, $encode = true, $deleted = true)
 {
     if ($id == '-99') {
         $this->name = $this->getDefaultCurrencyName();
         $this->symbol = $this->getDefaultCurrencySymbol();
         $this->id = '-99';
         $this->conversion_rate = 1;
         $this->iso4217 = $this->getDefaultISO4217();
         $this->deleted = 0;
         $this->status = 'Active';
         $this->hide = '<!--';
         $this->unhide = '-->';
     } else {
         parent::retrieve($id, $encode, $deleted);
     }
     if (!isset($this->name) || $this->deleted == 1) {
         $this->name = $this->getDefaultCurrencyName();
         $this->symbol = $this->getDefaultCurrencySymbol();
         $this->conversion_rate = 1;
         $this->iso4217 = $this->getDefaultISO4217();
         $this->id = '-99';
         $this->deleted = 0;
         $this->status = 'Active';
         $this->hide = '<!--';
         $this->unhide = '-->';
     }
     return $this;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:28,代码来源:Currency.php

示例10: populateFromPost

/**
 * Populating bean from $_POST
 *
 * @param string $prefix of name of fields
 * @param SugarBean $focus bean
 * @param bool $skipRetrieve do not retrieve data of bean
 * @param bool $checkACL do not update fields if they are forbidden for current user
 * @return SugarBean
 */
function populateFromPost($prefix, &$focus, $skipRetrieve = false, $checkACL = false)
{
    global $current_user;
    if (!empty($_REQUEST[$prefix . 'record']) && !$skipRetrieve) {
        $focus->retrieve($_REQUEST[$prefix . 'record']);
    }
    if (!empty($_POST['assigned_user_id']) && $focus->assigned_user_id != $_POST['assigned_user_id'] && $_POST['assigned_user_id'] != $current_user->id) {
        $GLOBALS['check_notify'] = true;
    }
    require_once 'include/SugarFields/SugarFieldHandler.php';
    $sfh = new SugarFieldHandler();
    $isOwner = $focus->isOwner($current_user->id);
    $relatedFields = array();
    foreach ($focus->field_defs as $field => $def) {
        if (empty($def['type']) || $def['type'] != 'relate') {
            continue;
        }
        if (empty($def['source']) || $def['source'] != 'non-db') {
            continue;
        }
        if (empty($def['id_name']) || $def['id_name'] == $field) {
            continue;
        }
        $relatedFields[$def['id_name']] = $field;
    }
    foreach ($focus->field_defs as $field => $def) {
        if ($field == 'id' && !empty($focus->id)) {
            // Don't try and overwrite the ID
            continue;
        }
        $type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type'];
        $sf = $sfh->getSugarField($type);
        if ($sf != null) {
            $sf->save($focus, $_POST, $field, $def, $prefix);
        } else {
            $GLOBALS['log']->fatal("Field '{$field}' does not have a SugarField handler");
        }
        /*
                if(isset($_POST[$prefix.$field])) {
        			if(is_array($_POST[$prefix.$field]) && !empty($focus->field_defs[$field]['isMultiSelect'])) {
        				if($_POST[$prefix.$field][0] === '' && !empty($_POST[$prefix.$field][1]) ) {
        					unset($_POST[$prefix.$field][0]);
        				}
        				$_POST[$prefix.$field] = encodeMultienumValue($_POST[$prefix.$field]);	
        			}
        
        			$focus->$field = $_POST[$prefix.$field];
        			/* 
        			 * overrides the passed value for booleans.
        			 * this will be fully deprecated when the change to binary booleans is complete.
        			 /
        			if(isset($focus->field_defs[$prefix.$field]) && $focus->field_defs[$prefix.$field]['type'] == 'bool' && isset($focus->field_defs[$prefix.$field]['options'])) {
        				$opts = explode("|", $focus->field_defs[$prefix.$field]['options']);
        				$bool = $_POST[$prefix.$field];
        
        				if(is_int($bool) || ($bool === "0" || $bool === "1" || $bool === "2")) {
        					// 1=on, 2=off
        					$selection = ($_POST[$prefix.$field] == "0") ? 1 : 0;
        				} elseif(is_bool($_POST[$prefix.$field])) {
        					// true=on, false=off
        					$selection = ($_POST[$prefix.$field]) ? 0 : 1;
        				}
        				$focus->$field = $opts[$selection];
        			}
        		} else if(!empty($focus->field_defs[$field]['isMultiSelect']) && !isset($_POST[$prefix.$field]) && isset($_POST[$prefix.$field . '_multiselect'])) {
        			$focus->$field = '';
        		}
        */
    }
    foreach ($focus->additional_column_fields as $field) {
        if (isset($_POST[$prefix . $field])) {
            $value = $_POST[$prefix . $field];
            $focus->{$field} = $value;
        }
    }
    return $focus;
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:86,代码来源:formbase.php

示例11: retrieve

 /**
  * @see SugarBean::retrieve()
  */
 public function retrieve($id = -1, $encode = true, $deleted = true)
 {
     $returnVal = parent::retrieve($id, $encode, $deleted);
     if (!$returnVal instanceof $this) {
         return $returnVal;
     }
     if ($this->source == 'tab' && $this->delimiter == '') {
         $this->delimiter = "\t";
     }
     return $this;
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:14,代码来源:ImportMap.php

示例12: retrieve

 function retrieve($id = -1, $encode = false, $deleted = true)
 {
     $ret = parent::retrieve($id, $encode, $deleted);
     return $ret;
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:5,代码来源:DocumentRevision.php

示例13: retrieve

 /**
  * retrieves I-E bean
  * @param string id
  * @return object Bean
  */
 function retrieve($id, $encode = true, $deleted = true)
 {
     $ret = parent::retrieve($id, $encode, $deleted);
     // if I-E bean exist
     if (!is_null($ret)) {
         $this->retrieveMailBoxFolders();
     }
     return $ret;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:InboundEmail.php

示例14: retrieve

 function retrieve($id = -1, $encode = true)
 {
     global $locale;
     $ret_val = parent::retrieve($id, $encode);
     // make a properly formatted first and last name
     $this->_create_proper_name_field();
     return $ret_val;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:8,代码来源:Lead.php

示例15: retrieve

 /**
  * retrieve
  *
  * returns currency object for given id, or base if none given
  *
  * @param  string   $id      currency id
  * @param  boolean  $encode
  * @param  boolean  $deleted
  * @return object   currency object, base currency if id is not found
  */
 function retrieve($id, $encode = true, $deleted = true)
 {
     if (empty($id) || $id == '-99') {
         $this->setBaseCurrency();
     } else {
         parent::retrieve($id, $encode, $deleted);
     }
     if (!isset($this->name) || $this->deleted == 1) {
         $this->setBaseCurrency();
     }
     return $this;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:22,代码来源:Currency.php


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