WhitePagesPersistenceStrategyPdo
in package
implements
WhitePagesPersistenceStrategy
Uses PDO for storing white pages profiles.
Interfaces, Classes, Traits and Enums
- WhitePagesPersistenceStrategy
- Interface for white pages profile persistence.
Table of Contents
- TABLE_NAME = 'white_pages_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 white pages profile.
- getProfiles() : array<string|int, string>
- Returns a list of available white pages profiles.
- load() : WhitePagesProfile
- Loads the given white pages profile.
- rename() : void
- Renames a white pages profile.
- save() : void
- Stores the given profile.
- checkSchema() : void
- Checks if the schema has the latest version.
Constants
TABLE_NAME
private
mixed
TABLE_NAME
= 'white_pages_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) : bool
Parameters
- $name : string
-
profile name
Tags
Return values
bool —can be written
createInitialSchema()
Creates the initial schema.
public
createInitialSchema() : void
Return values
void —delete()
Deletes a white pages profile.
public
delete(string $name) : void
Parameters
- $name : string
-
profile name
Tags
Return values
void —getProfiles()
Returns a list of available white pages profiles.
public
getProfiles() : array<string|int, string>
Tags
Return values
array<string|int, string> —profile names
load()
Loads the given white pages profile.
public
load(string $name) : WhitePagesProfile
Parameters
- $name : string
-
profile name
Tags
Return values
WhitePagesProfile —profile
rename()
Renames a white pages profile.
public
rename(string $oldName, string $newName) : void
Parameters
- $oldName : string
-
existing profile name
- $newName : string
-
new profile name
Tags
Return values
void —save()
Stores the given profile.
public
save(string $name, WhitePagesProfile $profile) : void
Parameters
- $name : string
-
profile name
- $profile : WhitePagesProfile
-
profile
Tags
Return values
void —checkSchema()
Checks if the schema has the latest version.
private
checkSchema() : void