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


PHP ImportMap::retrieve_by_string_fields方法代碼示例

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


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

示例1: testSaveMappingFileSavesNumberFieldAssociationCorrectly

 public function testSaveMappingFileSavesNumberFieldAssociationCorrectly()
 {
     $lead = new Lead();
     $importSource = new ImportFile($this->testFile, ',', '', false);
     $importer = new Bug61172TestImporterMock($importSource, $lead);
     $importer->saveMappingFile();
     $mappingFile = new ImportMap();
     $mappingFile->retrieve_by_string_fields(array('name' => $_REQUEST['save_map_as']));
     $this->assertNotEmpty($mappingFile->content);
     $contentFields = explode('&', $mappingFile->content);
     $this->assertContains('1=status', $contentFields, "Field status should be associated with #1");
     $mappingFile->mark_deleted($mappingFile->id);
 }
開發者ID:delkyd,項目名稱:sugarcrm_dev,代碼行數:13,代碼來源:Bug61172Test.php

示例2: ImportMap

 function mark_published($user_id, $flag)
 {
     $other_map = new ImportMap();
     if ($flag == 'yes') {
         // if you are trying to publish your map
         // but there's another published map
         // by the same name
         $query_arr = array('name' => $this->name, 'is_published' => 'yes');
     } else {
         // if you are trying to unpublish a map
         // but you own an unpublished map by the same name
         $query_arr = array('name' => $this->name, 'assigned_user_id' => $user_id, 'is_published' => 'no');
     }
     $other_map->retrieve_by_string_fields($query_arr, false);
     if (isset($other_map->id)) {
         //.. don't do it!
         return -1;
     }
     $query = "UPDATE {$this->table_name} set is_published='{$flag}', assigned_user_id='{$user_id}' where id='" . $this->id . "'";
     $this->db->query($query, true, "Error marking import map published: ");
     return 1;
 }
開發者ID:BackupTheBerlios,項目名稱:livealphaprint,代碼行數:22,代碼來源:ImportMap.php

示例3: mark_published

 /**
  * Mark an import map as published
  *
  * @param  string $user_id
  * @param  bool   $flag     true if we are publishing or false if we are unpublishing
  * @return bool
  */
 public function mark_published($user_id, $flag)
 {
     global $current_user;
     if (!is_admin($current_user)) {
         return false;
     }
     // check for problems
     if ($flag) {
         // if you are trying to publish your map
         // but there's another published map
         // by the same name
         $query_arr = array('name' => $this->name, 'is_published' => 'yes');
     } else {
         // if you are trying to unpublish a map
         // but you own an unpublished map by the same name
         $query_arr = array('name' => $this->name, 'assigned_user_id' => $user_id, 'is_published' => 'no');
     }
     $other_map = new ImportMap();
     $other_map->retrieve_by_string_fields($query_arr, false);
     // if we find this other map, quit
     if (isset($other_map->id)) {
         return false;
     }
     // otherwise update the is_published flag
     $query = "UPDATE {$this->table_name}\n                    SET is_published = '" . ($flag ? 'yes' : 'no') . "',\n                        assigned_user_id = '{$user_id}'\n                    WHERE id = '{$this->id}'";
     $this->db->query($query, true, "Error marking import map published: ");
     return true;
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:35,代碼來源:ImportMap.php


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