class BindingService implements LoggerAwareInterface (View source)

Traits

Trait LoggerAwareTrait A trait used with LoggerAwareInterface

LoggerAwareTrait

Properties

protected DatabaseManager $databaseManager

Methods

getLoggerChannel()

Get the logger channel expected by this LoggerAwareTrait implementation The user is expected to declare this method and return a valid channel name.

__construct(DatabaseManager $databaseManager)

No description

int
clearBinding(int $userId, int|string $binding, string $namespace, bool $matchBoth = false)

Clear bindings for BOTH the given binding and for the given user id in a given namespace.

int|null
getBoundUserId(int|string $binding, string $namespace)

Get the bound user id.

string|null
getUserBinding(int $userId, string $namespace)

Get the bound binding.

bool
bindUserId(int $id, int|string $binding, string $namespace)

Bind a user against a remote binding in a namespace EX: $bindings->bindUserId($id, $facebookUserId, 'facebook');.

bool
bindUser(User $user, int|string $binding, string $namespace)

Bind a user object to a given binding.

bool
bindUserInfo(UserInfo $user, int|string $binding, string $namespace)

Bind a user info object to a given binding.

bool
bindUserEntity(User $user, int|string $binding, string $namespace)

Bind a user entity object to a given binding.

getConnection()

No description

Details

getLoggerChannel()

Get the logger channel expected by this LoggerAwareTrait implementation The user is expected to declare this method and return a valid channel name.

__construct(DatabaseManager $databaseManager)

No description

Parameters

DatabaseManager $databaseManager

int clearBinding(int $userId, int|string $binding, string $namespace, bool $matchBoth = false)

Clear bindings for BOTH the given binding and for the given user id in a given namespace.

Parameters

int $userId

The user to clear bindings for

int|string $binding

The binding to clear

string $namespace

The namespace to clear bindings and user ids in

bool $matchBoth

Match the userID and binding instead of one or the other

Return Value

int

int|null getBoundUserId(int|string $binding, string $namespace)

Get the bound user id.

Parameters

int|string $binding
string $namespace

Return Value

int|null

Returns null when no user id is bound

string|null getUserBinding(int $userId, string $namespace)

Get the bound binding.

Parameters

int $userId

The user ID whose binding is being searched

string $namespace

The namespace to find a binding in

Return Value

string|null

Returns null when no binding is bound, this method will return a string even if an int was bound

bool bindUserId(int $id, int|string $binding, string $namespace)

Bind a user against a remote binding in a namespace EX: $bindings->bindUserId($id, $facebookUserId, 'facebook');.

Parameters

int $id

The user ID

int|string $binding

The binding to associate the user with

string $namespace

The namespace for this binding

Return Value

bool

Exceptions

Throwable

bool bindUser(User $user, int|string $binding, string $namespace)

Bind a user object to a given binding.

Parameters

User $user

The user to bind to the binding value

int|string $binding

The value to bind this user to

string $namespace

The namespace for this binding

Return Value

bool

Exceptions

Throwable

bool bindUserInfo(UserInfo $user, int|string $binding, string $namespace)

Bind a user info object to a given binding.

Parameters

UserInfo $user

The user to bind to the binding value

int|string $binding

The value to bind this user to

string $namespace

The namespace for this binding

Return Value

bool

Exceptions

Throwable

bool bindUserEntity(User $user, int|string $binding, string $namespace)

Bind a user entity object to a given binding.

Parameters

User $user

The user to bind to the binding value

int|string $binding

The value to bind this user to

string $namespace

The namespace for this binding

Return Value

bool

Exceptions

Throwable

protected Connection getConnection()

No description

Return Value

Connection