本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例4: retrieve
function retrieve($id = -1)
{
$bean = parent::retrieve($id);
if ($bean != null) {
if (!SimpleTeams::checkAccess($bean)) {
$bean = null;
}
}
return $bean;
}
示例5: retrieve
function retrieve($id = NULL, $encode = false)
{
$bean = parent::retrieve($id, $encode);
if ($bean != null) {
if (!SimpleTeams::checkAccess($bean)) {
$bean = null;
}
}
return $bean;
}
示例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;
}
示例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;
}
示例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.
}
示例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;
}
示例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;
}
示例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;
}
示例12: retrieve
function retrieve($id = -1, $encode = false, $deleted = true)
{
$ret = parent::retrieve($id, $encode, $deleted);
return $ret;
}
示例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;
}
示例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;
}
示例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;
}