public function __construct(PersonObjectBuilder $builder) { parent::__construct($builder->getObjectID()); $this->globalID = $builder->getGlobalID(); $this->displayName = $builder->getDisplayName(); $this->profilePictureThumbnail = $builder->getProfilePictureThumbnail(); $this->profilePicture = $builder->getProfilePicture(); $this->language = $builder->getLanguage(); }
public static function performGETPersonRequest($targetedGID) { // create an instance of PersonRequestBuilder $personRequest = new PersonRequestBuilder($targetedGID); // perform the request $response = $personRequest->createGETPerson()->dispatch(); // to access contents of the response, use // $response->getPayload(); <-- the actual object data // $response->getResponseBody(); <-- the complete response body // return the Person object from the responses payload return PersonObjectBuilder::buildFromJSON($response->getPayload()); }