diff --git a/src/Instagram/Hydrator/ProfileHydrator.php b/src/Instagram/Hydrator/ProfileHydrator.php index 2e7345d..ca41f97 100644 --- a/src/Instagram/Hydrator/ProfileHydrator.php +++ b/src/Instagram/Hydrator/ProfileHydrator.php @@ -43,6 +43,10 @@ public function hydrateProfile(\StdClass $data): void $this->profile->setVerified($data->is_verified); $this->profile->setMediaCount($data->edge_owner_to_timeline_media->count); + if (property_exists($data, 'category_name') && $data->category_name !== null) { + $this->profile->setCategoryName($data->category_name); + } + if (property_exists($data, 'biography')) { $this->profile->setBiography($data->biography); } diff --git a/src/Instagram/Model/Profile.php b/src/Instagram/Model/Profile.php index 06f0c52..062da8e 100644 --- a/src/Instagram/Model/Profile.php +++ b/src/Instagram/Model/Profile.php @@ -26,6 +26,11 @@ class Profile */ private $fullName; + /** + * @var string + */ + private $categoryName; + /** * @var string */ @@ -128,6 +133,23 @@ public function setFullName(string $fullName): void $this->fullName = $fullName; } + /** + * @return string|null + */ + public function getCategoryName(): ?string + { + return $this->categoryName; + } + + /** + * @param string $categoryName + * @return void + */ + public function setCategoryName(string $categoryName): void + { + $this->categoryName = $categoryName; + } + /** * @return string */