Instagram\Instagram::editUserProfile PHP Method

editUserProfile() public method

Edit User Profile
public editUserProfile ( string $firstname = null, string $email = null, string $phoneNumber = null, integer $gender = null, string $biography = null, string $externalUrl = null ) : EditProfileAccountResponse
$firstname string First Name
$email string Email
$phoneNumber string Phone Number
$gender integer Gender (Constants available in User class)
$biography string Biography
$externalUrl string External Url
return Instagram\API\Response\EditProfileAccountResponse
    public function editUserProfile($firstname = null, $email = null, $phoneNumber = null, $gender = null, $biography = null, $externalUrl = null)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call editUserProfile().");
        }
        $currentUser = $this->getCurrentUserAccount()->getUser();
        if ($firstname == null) {
            $firstname = $currentUser->getFullName();
        }
        if ($email == null) {
            $email = $currentUser->getEmail();
        }
        if ($phoneNumber == null) {
            $phoneNumber = $currentUser->getPhoneNumber();
        }
        if ($gender == null) {
            $gender = $currentUser->getGender();
        }
        if ($biography == null) {
            $biography = $currentUser->getBiography();
        }
        if ($externalUrl == null) {
            $externalUrl = $currentUser->getExternalUrl();
        }
        $request = new EditProfileAccountRequest($this, $firstname, $email, $phoneNumber, $gender, $biography, $externalUrl);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to editUserProfile: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }