class ResourceOwner extends OAuthResponse

This class represents a resource owner

The resource owner is the user who authorizes an application to access their account. The application’s access to the user’s account is limited to the “scope” of the authorization granted

Constants

ADDRESS_MAPPING

Properties

private string $provider The name of the provider from OAuthResponse
private array $values The properties of the resource from OAuthResponse
private string $id The ID of the resource owner

Methods

__construct(string $provider, $id, array|object $values, array $mapping)

Constructs a ResourceOwner object

setPropertyValue(string $property, string $value, array $mapping)

Sets the value of a property

string
getProvider()

Returns the name of the provider

mixed|null
__get(string $property)

Allows direct read-only access to a property

bool
__isset(string $property)

Allows to test (isset) directly the existence of a property

mixed|null
__call(string $method, array $arguments)

Defines a dynamic getter for the properties.

rewind()

Rewinds back to the first property of the resource.

mixed
current()

Returns the current property

scalar
key()

Returns the name of the current property

next()

Moves forward to next property

bool
valid()

Checks if current position is valid

string
getId()

Returns the ID of the resource owner

Details

at line 42
__construct(string $provider, $id, array|object $values, array $mapping)

Constructs a ResourceOwner object

Parameters

string $provider the provider name.
$id
array|object $values the properties of the resource.
array $mapping Match between OAuth client fields and fields returned by the provider.

in OAuthResponse at line 60
protected setPropertyValue(string $property, string $value, array $mapping)

Sets the value of a property

Parameters

string $property the property name.
string $value the value of the property.
array $mapping Match between OAuth client fields and fields returned by the provider.

in OAuthResponse at line 75
string getProvider()

Returns the name of the provider

Return Value

string the provider name.

in OAuthResponse at line 86
mixed|null __get(string $property)

Allows direct read-only access to a property

Parameters

string $property the name of the property.

Return Value

mixed|null the value of the property or null if the propery doesn't exists.

in OAuthResponse at line 110
bool __isset(string $property)

Allows to test (isset) directly the existence of a property

Parameters

string $property the name of the property.

Return Value

bool true if the property exists, false otherwise

in OAuthResponse at line 124
mixed|null __call(string $method, array $arguments)

Defines a dynamic getter for the properties.

For example, if the property is named 'my_property', a call to the getMyProperty() method will get the value of my_property.

Parameters

string $method the name of the getter.
array $arguments arguments passed to the getter, ignored.

Return Value

mixed|null the value of the property or null

in OAuthResponse at line 159
rewind()

Rewinds back to the first property of the resource.

in OAuthResponse at line 168
mixed current()

Returns the current property

Return Value

mixed the current property

in OAuthResponse at line 177
scalar key()

Returns the name of the current property

Return Value

scalar the name of the current property

in OAuthResponse at line 184
next()

Moves forward to next property

in OAuthResponse at line 193
bool valid()

Checks if current position is valid

Return Value

bool true if current position is valid

at line 52
string getId()

Returns the ID of the resource owner

Return Value

string the ID of the resource owner