protected function pullCache($guid, $className) {
    // Increment the entity access count.
    if (!isset($this->entityCount[$guid])) {
      $this->entityCount[$guid] = 0;
    }
    $this->entityCount[$guid]++;
    if (isset($this->entityCache[$guid][$className])) {
      return (clone $this->entityCache[$guid][$className]);
    }
    return null;
  }