Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP Academy] - Challenge 1 by Fernando Alvarez #2

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

[PHP Academy] - Challenge 1 by Fernando Alvarez #2

wants to merge 5 commits into from

Conversation

fernyettheplant
Copy link

Implementation of the First Challenge

@fernyettheplant fernyettheplant changed the title Challenge 1 by Fernando Alvarez [PHP Academy] - Challenge 1 by Fernando Alvarez Sep 10, 2018
$this->info('Getting Info to start to import');
$paginationMetadata = $this->eventDataProvider->getPaginationMetadataByLocation($location);

for ($page = 1; $page <= $paginationMetadata->page_count; $page++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine, we could improve this using a do while or even return an iterator from the data provider to handle the iteration over the pagination.

$lastPage = ceil($total/$size);
$items = $pageCursor->toArray();

return response()->json([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -3,6 +3,7 @@
namespace App\Jobs;

use MongoDB\Client as MongoClient;
use App\Importer\Contracts\VenueDataProvider as IVenueDataProvider;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# interface naming convention :baia-baia:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants