Skip to content

Commit

Permalink
Fixes #94. getMedias not returning owner
Browse files Browse the repository at this point in the history
  • Loading branch information
raiym committed Apr 19, 2017
1 parent 9d402cd commit eb39c1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/InstagramScraper/Model/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public static function fromMediaPage($userArray)
$instance->profilePicUrl = $userArray['profile_pic_url'];
$instance->username = $userArray['username'];
$instance->fullName = $userArray['full_name'];
$instance->isPrivate = $userArray['is_private'];
if (isset($userArray['is_private'])) {
$instance->isPrivate = $userArray['is_private'];
}
return $instance;
}

Expand Down
2 changes: 2 additions & 0 deletions src/InstagramScraper/Model/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public static function fromApi($mediaArray)
if (isset($mediaArray['location']['name'])) {
$instance->locationName = $mediaArray['location']['name'];
}
$instance->owner = Account::fromMediaPage($mediaArray['user']);
$instance->ownerId = $instance->owner->id;
return $instance;
}

Expand Down

0 comments on commit eb39c1b

Please sign in to comment.