public function bulkIndexLocations(array $locations) { $documents = array(); foreach ($locations as $location) { $documents[] = $this->mapper->mapLocation($location); } $this->gateway->bulkIndex($documents); }