Snuze  0.8.1
snuze\Persistence\Interfaces\StorageProviderInterface Interface Reference
Inheritance diagram for snuze\Persistence\Interfaces\StorageProviderInterface:

Public Member Functions

 __construct (array $configurationParameters=[])
 getRequiredExtensionNames ()
 init ()
 getMapper (string $objectClass)

Detailed Description

The StorageProviderInterface is part of the storage provider design.

It defines methods that must be implemented by any StorageProvider object when developing a storage provider for Snuze.

This file is part of Snuze, a PHP client for the Reddit API. Copyright 2019 Shaun Cummiskey Repository: Documentation:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Constructor & Destructor Documentation

◆ __construct()

snuze\Persistence\Interfaces\StorageProviderInterface::__construct ( array  $configurationParameters = [])

The constructor must accept an array of all parameters necessary to initialize the storage facility. For example, a MySQL provider class might accept an array containing the server name, database name, username, and password.

If your provider requires no configuration parameters, it must still accept the array, but can simply disregard it.

string[]$configurationParameters An array of setup parameters.

Implemented in snuze\Persistence\MySQL\StorageProvider, and snuze\Persistence\SQLite\StorageProvider.

Member Function Documentation

◆ getRequiredExtensionNames()

snuze\Persistence\Interfaces\StorageProviderInterface::getRequiredExtensionNames ( )

Return an array containing the names of any PHP extensions this provider needs to operate. For example, a SQLite provider class would return an array containing the string 'pdo_sqlite'. This array will be queried by the SnuzeFactory, which will check that the extensions are present.

If your provider requires no PHP extensions, return an empty array.


Implemented in snuze\Persistence\AbstractStorageProvider.

◆ init()

snuze\Persistence\Interfaces\StorageProviderInterface::init ( )

Perform any actions necessary to initialize the storage facility. For example, a MySQL provider class might obtain a PDO handle to the target database.

If your provider requires no initialization, implement an empty method.


Implemented in snuze\Persistence\MySQL\StorageProvider, snuze\Persistence\AbstractStorageProvider, and snuze\Persistence\SQLite\StorageProvider.

The documentation for this interface was generated from the following file: