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


PHP Vtiger_Record_Model::getId方法代碼示例

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


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

示例1: __SaveAttachements

 /**
  * Save attachments from the email and add it to the module record.
  * @global PearDataBase $db
  * @global String $root_directory
  * @param MailManager_Message_Model $mailrecord
  * @param String $basemodule
  * @param Vtiger_Record_Model $recordModel
  */
 public function __SaveAttachements($mailrecord, $basemodule, $recordModel)
 {
     $db = PearDatabase::getInstance();
     // If there is no attachments return
     if (!$mailrecord->_attachments) {
         return;
     }
     $userid = $recordModel->get('assigned_user_id');
     $recordId = $recordModel->getId();
     $setype = "{$basemodule} Attachment";
     $date_var = $db->formatDate(date('YmdHis'), true);
     foreach ($mailrecord->_attachments as $filename => $filecontent) {
         if (empty($filecontent)) {
             continue;
         }
         $attachid = $db->getUniqueId('vtiger_crmentity');
         $description = $filename;
         $usetime = $db->formatDate($date_var, true);
         $db->pquery("INSERT INTO vtiger_crmentity(crmid, smcreatorid, smownerid,\n\t\t\t\tmodifiedby, setype, description, createdtime, modifiedtime, presence, deleted)\n\t\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array($attachid, $userid, $userid, $userid, $setype, $description, $usetime, $usetime, 1, 0));
         $issaved = $this->__SaveAttachmentFile($attachid, $filename, $filecontent);
         if ($issaved) {
             // To compute file size & type
             $attachRes = $db->pquery("SELECT * FROM vtiger_attachments WHERE attachmentsid = ?", array($attachid));
             if ($db->num_rows($attachRes)) {
                 $filePath = $db->query_result($attachRes, 0, 'path');
                 $completeFilePath = vglobal('root_directory') . $filePath . $attachid . '_' . $filename;
                 if (file_exists($completeFilePath)) {
                     $fileSize = filesize($completeFilePath);
                     $mimetype = MailAttachmentMIME::detect($completeFilePath);
                 }
             }
             // Link file attached to emails also, for it to appear on email's page
             if (!empty($recordId) && !empty($attachid)) {
                 $this->relateAttachment($recordId, $attachid);
             }
         }
     }
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:46,代碼來源:Relate.php

示例2: saveRecord

 public function saveRecord(Vtiger_Record_Model $recordModel)
 {
     $moduleName = $this->get('name');
     $focus = CRMEntity::getInstance($moduleName);
     $fields = $focus->column_fields;
     foreach ($fields as $fieldName => $fieldValue) {
         $fieldValue = $recordModel->get($fieldName);
         if (is_array($fieldValue)) {
             $focus->column_fields[$fieldName] = $fieldValue;
         } else {
             if ($fieldValue !== null) {
                 if (in_array($fieldName, array('header_content', 'content', 'footer_content'))) {
                     $focus->column_fields[$fieldName] = $fieldValue;
                 } else {
                     $focus->column_fields[$fieldName] = decode_html($fieldValue);
                 }
             }
         }
     }
     $focus->mode = $recordModel->get('mode');
     $focus->id = $recordModel->getId();
     $focus->save($moduleName);
     return $recordModel->setId($focus->id);
 }
開發者ID:Bergdahls,項目名稱:YetiForceCRM,代碼行數:24,代碼來源:Module.php

示例3: deleteRecord

 /**
  * Function to delete a given record model of the current module
  * @param Vtiger_Record_Model $recordModel
  */
 public function deleteRecord($recordModel)
 {
     $moduleName = $this->get('name');
     $focus = CRMEntity::getInstance($moduleName);
     $focus->trash($moduleName, $recordModel->getId());
     if (method_exists($focus, 'transferRelatedRecords')) {
         if ($recordModel->get('transferRecordIDs')) {
             $focus->transferRelatedRecords($moduleName, $recordModel->get('transferRecordIDs'), $recordModel->getId());
         }
     }
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:15,代碼來源:Module.php

示例4: deleteRecord

 /**
  * Function to delete a given record model of the current module
  * @param Vtiger_Record_Model $recordModel
  */
 public function deleteRecord($recordModel)
 {
     $db = PearDatabase::getInstance();
     $moduleName = $this->get('name');
     $date_var = date('Y-m-d H:i:s');
     $query = "UPDATE vtiger_users SET status=?, date_modified=?, modified_user_id=? WHERE id=?";
     $db->pquery($query, array('Inactive', $adb->formatDate($date_var, true), $recordModel->getId(), $recordModel->getId()), true, "Error marking record deleted: ");
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:12,代碼來源:Module.php

示例5: deleteRecord

 /**
  * Function to delete a given record model of the current module
  * @param Vtiger_Record_Model $recordModel
  */
 public function deleteRecord($recordModel)
 {
     $moduleName = $this->get('name');
     $focus = CRMEntity::getInstance($moduleName);
     $focus->trash($moduleName, $recordModel->getId());
     if (method_exists($focus, 'transferRelatedRecords')) {
         if ($recordModel->get('transferRecordIDs')) {
             $focus->transferRelatedRecords($moduleName, $recordModel->get('transferRecordIDs'), $recordModel->getId());
         }
     }
     vimport('~~modules/com_vtiger_workflow/include.inc');
     vimport('~~modules/com_vtiger_workflow/VTEntityMethodManager.inc');
     $wfs = new VTWorkflowManager(PearDatabase::getInstance());
     $workflows = $wfs->getWorkflowsForModule($moduleName, VTWorkflowManager::$ON_DELETE);
     if (count($workflows)) {
         $wsId = vtws_getWebserviceEntityId($moduleName, $recordModel->getId());
         $entityCache = new VTEntityCache(Users_Record_Model::getCurrentUserModel());
         $entityData = $entityCache->forId($wsId);
         foreach ($workflows as $id => $workflow) {
             if ($workflow->evaluate($entityCache, $entityData->getId())) {
                 $workflow->performTasks($entityData);
             }
         }
     }
 }
開發者ID:noclav,項目名稱:UpdatePackages,代碼行數:29,代碼來源:Module.php


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