/** * 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; } } }
/** * 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; }
/** * Get login result from SOAP client * * @return LoginResult */ protected function getLoginResult() { return $this->soapClient->getLoginResult(); }
/** * Query Salesforce for more records and rewind iterator */ protected function queryMore() { $this->setQueryResult($this->client->queryMore($this->queryResult->getQueryLocator())->getQueryResult()); $this->rewind(); }