Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Update the GraphAlbum #533

Closed
wants to merge 1 commit into from
Closed

Update the GraphAlbum #533

wants to merge 1 commit into from

Conversation

devmsh
Copy link
Contributor

@devmsh devmsh commented Nov 6, 2015

generate the Node class based on the latest metadata from Graph API
metadata.

generate the Node class based on the latest metadata from Graph API
metadata.
@devmsh
Copy link
Contributor Author

devmsh commented Nov 6, 2015

I will update the tests and docs once reviewed :)

@gfosco
Copy link
Contributor

gfosco commented Nov 7, 2015

Looks alright to me.. continue. 👍

*
* @return GraphUser|null
* @return GraphNode|null
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from the Graph API metadata

{
        "name": "from",
        "description": "The profile that created the album",
        "type": "user|page"
      },

The album may created by User or Page, so it must be returned as GraphNode, or as I suggest before, we can have something called GraphProfile as a super class of GraphUser and GraphPage to some common functionality like name, username, picture, ... etc.

So I remove the auto cast, and change the return type to GraphNode until we have another option?

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha. Well this would be a BC (see the failing test). So we probably need to figure a way to support these changes from Graph without breaking the SDK. @yguedidi Any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

What about something like:

    /**
     * Returns the profile that created the album.
     *
     * @param bool @isPage true if you want a GraphPage instance
     *
     * @return GraphUser|GraphPage|null
     */
    public function getFrom($isPage = false)
    {
        if (!$isPage) {
             return $this->getField('from');
        }

        // return a casted to a GraphPage instance
    }

I'm not really sur. But for now, all users get a GraphUser instance, so I think we should keep this behavior as the default, and provide a way to get a GraphPage. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 to @return GraphUser|GraphPage|null docblock :)

@gfosco
Copy link
Contributor

gfosco commented Dec 16, 2015

Status on this, @devmsh ?

@SammyK SammyK added this to the 5.2.0 milestone May 18, 2016
@SammyK
Copy link
Contributor

SammyK commented May 18, 2016

Hey @devmsh! Were you able to finish this one out? It'd be great to get this merged in for the next minor release. :)

@SammyK SammyK modified the milestones: 5.3.0, 5.2.0 May 18, 2016
@ghost ghost added the CLA Signed label Jul 12, 2016
@SammyK
Copy link
Contributor

SammyK commented Aug 6, 2016

Ping @devmsh. We cool with wrapping this one up? I'd like to merge it in without breaking the build on master. :)

@SammyK SammyK modified the milestones: 5.4.0, 5.3.0 Aug 6, 2016
@ghost ghost added the CLA Signed label Aug 6, 2016
@devmsh
Copy link
Contributor Author

devmsh commented Aug 7, 2016

Sorry, I was very busy recently.

I will make sure to update the PR maximum tomorrow, and I will review the current SDK status and resume my contributions :)

@SammyK
Copy link
Contributor

SammyK commented Aug 7, 2016

@devmsh - no worries at all! I've also be crazy busy. Thanks! :)

@ghost ghost added the CLA Signed label Aug 7, 2016
@SammyK SammyK modified the milestones: 5.5.0, 5.4.0 Oct 12, 2016
@yguedidi yguedidi changed the base branch from master to 5.x December 3, 2017 22:52
@yguedidi
Copy link
Contributor

@devmsh it's been a while... how are you? Do you think you could update this PR? :)

@yguedidi yguedidi removed this from the 5.5.0 milestone Nov 14, 2018
@devmsh devmsh closed this Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants