Programming Language PHP

Namespace Instagram\Model

Class MediaDetailed

Method/Function setDisplayResources

Total Examples 1

1 code examples of PHP Instagram\Model\MediaDetailed::setDisplayResources extracted from open source projects

Was this example useful?
0
                                                    /**
     * @return MediaDetailed
     */
    private function mediaDetailedDataHydrator(MediaDetailed $media, \StdClass $node): Media
    {
        $media->setDisplayResources($node->image_versions2->candidates);

        $media->setHeight($node->original_height);
        $media->setWidth($node->original_width);

        if ($this->isVideo($node)) {
            $media->setHasAudio($node->has_audio);
        }

        if (property_exists($node, 'usertags')) {
            $taggedUsers = [];
            foreach ($node->usertags->in as $user) {
                $taggedUsers[] = $user->user;
            }

            $media->setTaggedUsers($taggedUsers);
        }

        return $media;
    }