diff --git a/src/Instagram/Hydrator/ProfileHydrator.php b/src/Instagram/Hydrator/ProfileHydrator.php index da48e07..ef731bd 100644 --- a/src/Instagram/Hydrator/ProfileHydrator.php +++ b/src/Instagram/Hydrator/ProfileHydrator.php @@ -35,6 +35,7 @@ public function __construct(Profile $instagramProfile = null) public function hydrateProfile(\StdClass $data): void { $this->profile->setId((int)$data->id); + $this->profile->setId32Bit($data->id); $this->profile->setUserName($data->username); $this->profile->setFullName($data->full_name); $this->profile->setBiography($data->biography); diff --git a/src/Instagram/Model/Profile.php b/src/Instagram/Model/Profile.php index 9fcf5e5..a3d7433 100644 --- a/src/Instagram/Model/Profile.php +++ b/src/Instagram/Model/Profile.php @@ -11,6 +11,11 @@ class Profile */ private $id; + /** + * @var string + */ + private $id32Bit; + /** * @var string */ @@ -338,4 +343,20 @@ public function __serialize(): array { return $this->toArray(); } + + /** + * @return string + */ + public function getId32Bit(): string + { + return $this->id32Bit; + } + + /** + * @param string $id32Bit + */ + public function setId32Bit(string $id32Bit): void + { + $this->id32Bit = $id32Bit; + } } diff --git a/src/Instagram/Transport/JsonMediasDataFeed.php b/src/Instagram/Transport/JsonMediasDataFeed.php index 7b07be8..df48b85 100644 --- a/src/Instagram/Transport/JsonMediasDataFeed.php +++ b/src/Instagram/Transport/JsonMediasDataFeed.php @@ -19,7 +19,7 @@ class JsonMediasDataFeed extends AbstractDataFeed public function fetchData(Profile $instagramProfile): \StdClass { $variables = [ - 'id' => $instagramProfile->getId(), + 'id' => PHP_INT_SIZE === 4 ? $instagramProfile->getId32Bit() : $instagramProfile->getId(), 'first' => InstagramHelper::PAGINATION_DEFAULT, 'after' => $instagramProfile->getEndCursor(), ];