• PHP reference
  • Models
  • Traits

HasExternalAccounts

trait Models\Traits\HasExternalAccounts

Trait HasExternalAccounts

Properties

DB $db

Methods

boolean add_external_account(string $type, mixed $external_id, null $external_token = null)

Add a link with an external account to the current user account.

Parameters

  • string $type
  • mixed $external_id
  • null $external_token

Return Value

  • boolean

array get_external_accounts()

Returns the user's linked accounts as an array of database objects, ordered by descending time created (newest is first item in the array).

Return Value

  • array

static null|User get_by_external_account(string $type, mixed $external_id)

Get a user by their linked account, otherwise returns null.

Parameters

  • string $type
  • mixed $external_id

Return Value

Exceptions