示例#1
0
 /**
  * Fills the cache with all sobject describe
  * data for each (custom) object available at
  * the organization.
  *
  * @return void
  */
 public function warmup()
 {
     if ($this->force) {
         $this->client->getConnection()->getCache()->delete('__global_describe');
     }
     $globalSobjectDescribes = $this->client->describeGlobal()->sobjects;
     $bulk = array();
     $n = 0;
     while (true) {
         $currenttype = current($globalSobjectDescribes)->name;
         // DELETE EXISTING CACHE ENTRIES
         if ($this->force) {
             $this->client->getConnection()->getCache()->delete($currenttype);
         }
         $bulk[] = $currenttype;
         if ($n === 99) {
             // FILLS CACHE
             $this->client->describeSObjects($bulk);
             $bulk = array();
             $n = 0;
             continue;
         }
         $n++;
         if (false === next($globalSobjectDescribes)) {
             break;
         }
     }
 }
示例#2
0
 /**
  * Flush upserts
  *
  * @param string $objectType
  * @return SaveResult[]
  */
 private function flushUpserts($objectType)
 {
     $result = $this->client->upsert($this->bulkUpsertMatchFields[$objectType], $this->bulkUpsertRecords[$objectType], $objectType);
     $this->bulkUpsertRecords[$objectType] = array();
     return $result;
 }
示例#3
0
 /**
  * Get login result from SOAP client
  *
  * @return LoginResult
  */
 protected function getLoginResult()
 {
     return $this->soapClient->getLoginResult();
 }
示例#4
0
 /**
  * Query Salesforce for more records and rewind iterator
  */
 protected function queryMore()
 {
     $this->setQueryResult($this->client->queryMore($this->queryResult->getQueryLocator())->getQueryResult());
     $this->rewind();
 }