private function fetchVocabElements() { if ($this->vocabElements == null) { $factory = new FamilySearchStateFactory(); $this->collection = $factory->newPlacesState()->authenticateViaOAuth2Password(SandboxCredentials::USERNAME, SandboxCredentials::PASSWORD, SandboxCredentials::API_KEY); $this->vocabListState = $this->collection->readPlaceTypes(); $this->vocabElements = $this->vocabListState->getVocabElementList()->getElements(); } }