Created
September 5, 2016 13:08
-
-
Save hannesvdvreken/1e13cb769d85be95f43bf2f745d5b9c6 to your computer and use it in GitHub Desktop.
functions.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getProperties() | |
{ | |
$page = 0; | |
$perPage = 30; | |
do { | |
++$page; | |
$this->propertiesToBeGeneratedQuery->paginate($page, $perPage); | |
$results = $this->propertiesToBeGeneratedQuery->run(); | |
foreach ($results->getResults() as $property) { | |
yield $property; | |
} | |
} while (($perPage * $page) < $results->getTotal()); | |
} | |
public function doGuzzleRequests() | |
{ | |
foreach ($this->getProperties() as $property) { | |
// $this->client->get(...); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment