當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SugarBean::save方法代碼示例

本文整理匯總了PHP中SugarBean::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarBean::save方法的具體用法?PHP SugarBean::save怎麽用?PHP SugarBean::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SugarBean的用法示例。


在下文中一共展示了SugarBean::save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 function save($check_notify = false)
 {
     parent::save($check_notify);
     //update documents table.
     //$query = "UPDATE documents set document_version_id='$this->id' where id = '$this->document_id'";
     //$this->db->query($query);
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:7,代碼來源:KBDocumentRevision.php

示例2: save

 function save($check_notify = FALSE)
 {
     if (empty($this->status)) {
         $this->status = $this->getDefaultStatus();
     }
     return parent::save($check_notify);
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:7,代碼來源:Task.php

示例3: save

 function save($check_notify = false)
 {
     if (!empty($this->number)) {
         $this->name = $this->number;
     }
     return parent::save($check_notify);
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:7,代碼來源:GuideContracts.php

示例4: save

 function save($check_notify = false)
 {
     require_once 'modules/Teams/TeamSetManager.php';
     TeamSetManager::flushBackendCache();
     sugar_cache_put("teamname_{$this->id}", $this->name);
     return parent::save($check_notify);
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:7,代碼來源:Team.php

示例5: save

 function save($check_notify = false)
 {
     global $sugar_config;
     if (!empty($_FILES['image_file'])) {
         if ($_FILES['image_file']['error'] == 0) {
             $file_name = $_FILES['image_file']['name'];
             $tmp_name = $_FILES['image_file']['tmp_name'];
             $ext = explode('.', $file_name);
             $img_ext = $ext[count($ext) - 1];
             $img_valid = false;
             $image_extension = 'jpg_jpeg_gif_bmp_png';
             $image_extension_arr = explode('_', $image_extension);
             for ($i = 0; $i < count($image_extension_arr); $i++) {
                 if ($img_ext != $image_extension_arr[$i]) {
                     $img_valid = true;
                 }
             }
             if ($img_valid == false) {
                 echo "<script language='javascript'> alert('file ảnh không hợp lệ'); </script>";
                 return;
             }
             if (is_file('modules/images/' . $this->image)) {
                 @unlink('modules/images/' . $this->image);
             }
             $destination = 'modules/images/' . $file_name;
             if (move_uploaded_file($tmp_name, $destination)) {
                 $this->picture = "<img src='" . $sugar_config['site_url'] . "/modules/images/" . $file_name . "' width='350' height='200'/>";
                 $this->image = $file_name;
             }
         }
     }
     return parent::save($check_notify);
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:33,代碼來源:Destination.php

示例6: save

 function save($id = '', $module = '', $new_addrs = array(), $primary = '', $replyTo = '', $invalid = '', $optOut = '', $in_workflow = false)
 {
     if (func_num_args() > 1) {
         parent::save($id, $module, $new_addrs, $primary, $replyTo, $invalid, $optOut, $in_workflow);
     } else {
         SugarBean::save($id);
     }
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:8,代碼來源:EmailAddress.php

示例7: save

 public function save()
 {
     $sql = "SELECT id FROM {$this->table_name} WHERE team_set_id = '{$this->team_set_id}' AND module_table_name = '{$this->module_table_name}'";
     $result = $this->db->query($sql);
     $row = $this->db->fetchByAssoc($result);
     if (!$row) {
         parent::save();
     }
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:9,代碼來源:TeamSetModule.php

示例8: action_resize

 /**
  * Action Resize
  * Used for drag & drop resizing
  */
 protected function action_resize()
 {
     $this->view = 'json';
     if (!$this->retrieveCurrentBean('Save')) {
         return;
     }
     require_once 'include/formbase.php';
     $this->currentBean = populateFromPost("", $this->currentBean);
     $this->currentBean->save();
     $this->view_object_map['jsonData'] = array('access' => 'yes');
 }
開發者ID:omusico,項目名稱:sugar_work,代碼行數:15,代碼來源:controller.php

示例9: save

 function save()
 {
     //make sure that the url has a scheme, if not then add http:// scheme
     if ($this->is_optout != 1) {
         $url = strtolower(trim($this->tracker_url));
         if (!preg_match('/^(http|https|ftp):\\/\\//i', $url)) {
             $this->tracker_url = 'http://' . $url;
         }
     }
     parent::save();
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:11,代碼來源:CampaignTracker.php

示例10: save

 public function save()
 {
     $hook = $this->getActionArray();
     if (!empty($this->fetched_row)) {
         $oldhook = $hook;
         // since remove_logic_hook compares 1, 3 and 4
         $oldhook[3] = 'WebLogicHook';
         remove_logic_hook($this->webhook_target_module, $this->trigger_event, $oldhook);
     }
     parent::save();
     $hook[5] = $this->id;
     check_logic_hook_file($this->webhook_target_module, $this->trigger_event, $hook);
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:13,代碼來源:WebLogicHook.php

示例11: save

 function save($check_notify = false)
 {
     $this->emailAddress->handleLegacySave($this, $this->module_dir);
     $email1_ori = $this->email1;
     $email2_ori = $this->email2;
     $this->in_workflow = false;
     parent::save($check_notify);
     $override_email = array();
     if ($this->in_workflow) {
         // workflow will edit this $this->email1 and $this->email2
         if ($email1_ori != $this->email1) {
             $override_email['emailAddress0'] = $this->email1;
         }
         if ($email2_ori != $this->email2) {
             $override_email['emailAddress1'] = $this->email2;
         }
     }
     $this->emailAddress->save($this->id, $this->module_dir, $override_email, '', '', '', '', $this->in_workflow);
     global $sugar_config;
     if (!empty($_FILES['image_file'])) {
         if ($_FILES['image_file']['error'] == 0) {
             $file_name = $_FILES['image_file']['name'];
             $tmp_name = $_FILES['image_file']['tmp_name'];
             $ext = explode('.', $file_name);
             $img_ext = $ext[count($ext) - 1];
             $img_valid = false;
             $image_extension = 'jpg_jpeg_gif_bmp_png';
             $image_extension_arr = explode('_', $image_extension);
             for ($i = 0; $i < count($image_extension_arr); $i++) {
                 if ($img_ext != $image_extension_arr[$i]) {
                     $img_valid = true;
                 }
             }
             if ($img_valid == false) {
                 echo "<script language='javascript'> alert('file ảnh không hợp lệ'); </script>";
                 return;
             }
             if (is_file('modules/images/' . $this->image)) {
                 @unlink('modules/images/' . $this->image);
             }
             $destination = 'modules/images/' . $file_name;
             if (move_uploaded_file($tmp_name, $destination)) {
                 $this->picture = "<img src='" . $sugar_config['site_url'] . "/modules/images/" . $file_name . "' width='350' height='200'/>";
                 $this->image = $file_name;
             }
         }
     }
     return $this->id;
     //return parent::save($check_notify);
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:50,代碼來源:Location.php

示例12: save

 function save($check_notify = false)
 {
     $saveRet = parent::save($check_notify);
     //update documents table. (not through save, because it causes a loop)
     // If we don't have a document_id, find it.
     if (empty($this->document_id)) {
         $query = "SELECT document_id FROM document_revisions WHERE id = '" . $this->db->quote($this->id) . "'";
         $ret = $this->db->query($query, true);
         $row = $this->db->fetchByAssoc($ret);
         $this->document_id = $row['document_id'];
     }
     $query = "UPDATE documents set document_revision_id='" . $this->db->quote($this->id) . "', doc_type='" . $this->db->quote($this->doc_type) . "', doc_url='" . $this->db->quote($this->doc_url) . "', doc_id='" . $this->db->quote($this->doc_id) . "' where id = '" . $this->db->quote($this->document_id) . "'";
     $this->db->query($query, true);
     return $saveRet;
 }
開發者ID:butschster,項目名稱:sugarcrm_dev,代碼行數:15,代碼來源:DocumentRevision.php

示例13: updateBean

 /**
  * Fetches data from the $args array and updates the bean with that data
  * @param $bean SugarBean The bean to be updated
  * @param $api ServiceBase The API class of the request, used in cases where the API changes how the fields are pulled from the args array.
  * @param $args array The arguments array passed in from the API
  * @return id Bean id
  */
 protected function updateBean(SugarBean $bean, ServiceBase $api, $args)
 {
     // Bug 54515: Set modified by and created by users to assigned to user. If not set default to admin.
     $bean->update_modified_by = false;
     $bean->set_created_by = false;
     $admin = Administration::getSettings();
     if (isset($admin->settings['supportPortal_RegCreatedBy']) && !empty($admin->settings['supportPortal_RegCreatedBy'])) {
         $bean->created_by = $admin->settings['supportPortal_RegCreatedBy'];
         $bean->modified_user_id = $admin->settings['supportPortal_RegCreatedBy'];
     } else {
         $bean->created_by = '1';
         $bean->modified_user_id = '1';
     }
     // Bug 54516 users not getting notified on new record creation
     $bean->save(true);
     return parent::updateBean($bean, $api, $args);
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:24,代碼來源:RegisterLeadApi.php

示例14: save

 function save($check_notify = FALSE)
 {
     parent::save($check_notify);
     //check for an remove invalid actions from this shell
     if (!empty($this->id)) {
         $actions = $this->get_actions($this->id);
         $workflow_object = $this->get_workflow_object();
         $temp_module = BeanFactory::getBean($workflow_object->base_module);
         $temp_module->call_vardef_handler("action_filter");
         $field_array = $temp_module->vardef_handler->get_vardef_array();
         foreach ($actions as $action) {
             if (!empty($action->field)) {
                 //Check if the actions field is still valid, if not remove the action
                 if (empty($field_array[$action->field])) {
                     $action->mark_deleted($action->id);
                 }
             }
         }
     }
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:20,代碼來源:WorkFlowActionShell.php

示例15: save

 function save($check_notify = false)
 {
     $this->emailAddress->handleLegacySave($this, $this->module_dir);
     $email1_ori = $this->email1;
     $email2_ori = $this->email2;
     $this->in_workflow = false;
     parent::save($check_notify);
     $override_email = array();
     if ($this->in_workflow) {
         // workflow will edit this $this->email1 and $this->email2
         if ($email1_ori != $this->email1) {
             $override_email['emailAddress0'] = $this->email1;
         }
         if ($email2_ori != $this->email2) {
             $override_email['emailAddress1'] = $this->email2;
         }
     }
     $this->emailAddress->save($this->id, $this->module_dir, $override_email, '', '', '', '', $this->in_workflow);
     return $this->id;
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:20,代碼來源:TravelGuide.php


注:本文中的SugarBean::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。