SelfServicePersistenceStrategyPdo
in package
implements
SelfServicePersistenceStrategy
Uses PDO for storing self service profiles.
Interfaces, Classes, Traits and Enums
- SelfServicePersistenceStrategy
- Interface for self service profile persistence.
Table of Contents
- TABLE_NAME = 'self_service_profiles'
- $pdo : PDO
- __construct() : mixed
- Constructor
- canWrite() : bool
- Returns if the profile with given name can be written.
- createInitialSchema() : void
- Creates the initial schema.
- delete() : void
- Deletes a self service profile.
- getProfiles() : array<string|int, mixed>
- Returns a list of available self service profiles.
- load() : selfServiceProfile
- Loads the given self service profile.
- rename() : void
- Renames a self service profile.
- save() : void
- Stores the given profile.
- checkSchema() : void
- Checks if the schema has latest version.
Constants
TABLE_NAME
public
mixed
TABLE_NAME
= 'self_service_profiles'
Properties
$pdo
private
PDO
$pdo
Methods
__construct()
Constructor
public
__construct(PDO $pdo) : mixed
Parameters
- $pdo : PDO
-
PDO
Return values
mixed —canWrite()
Returns if the profile with given name can be written.
public
canWrite(string $name, string $scope) : bool
Parameters
- $name : string
-
profile name
- $scope : string
-
user/group/host
Tags
Return values
bool —can be written
createInitialSchema()
Creates the initial schema.
public
createInitialSchema() : void
Return values
void —delete()
Deletes a self service profile.
public
delete(string $name, string $scope) : void
Parameters
- $name : string
-
profile name
- $scope : string
-
account type
Tags
Return values
void —getProfiles()
Returns a list of available self service profiles.
public
getProfiles() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —profile names (array('account type' => array('profile1', 'profile2')))
load()
Loads the given self service profile.
public
load(string $name, string $scope) : selfServiceProfile
Parameters
- $name : string
-
profile name
- $scope : string
-
user/group/host
Tags
Return values
selfServiceProfile —profile
rename()
Renames a self service profile.
public
rename(string $oldName, string $newName, string $scope) : void
Parameters
- $oldName : string
-
existing profile name
- $newName : string
-
new profile name
- $scope : string
-
user/group/host
Tags
Return values
void —save()
Stores the given profile.
public
save(string $name, string $scope, selfServiceProfile $profile) : void
Parameters
- $name : string
-
profile name
- $scope : string
-
user/group/host
- $profile : selfServiceProfile
-
profile
Tags
Return values
void —checkSchema()
Checks if the schema has latest version.
private
checkSchema() : void