Public Member Functions | |
getMapper (string $objectClass) | |
getRequiredExtensionNames () | |
init () | |
![]() | |
__construct (array $args=null) | |
_getSnuzeId () | |
_getSnuzeClass () | |
_ident () | |
![]() | |
__construct (array $configurationParameters=[]) | |
Static Protected Attributes | |
static | $mappers = [] |
Additional Inherited Members | |
![]() | |
debug (string $message, bool $echo=false) | |
info (string $message, bool $echo=false) | |
warning (string $message, bool $echo=false) | |
error (string $message, bool $echo=false) | |
![]() | |
$_snuzeId = null | |
$_snuzeClass = null | |
The AbstractStorageProvider contains basic implementations for two of the methods required by StorageProviderInterface; namely, getMapper() and getRequiredExtensionNames(). Depending on the type of storage involved, these "stubs" are likely capable of standing on their own, and probably don't need to be overridden.
If you want to develop your own Snuze storage provider, it will need to extend this class, implementing init() at the very least. Have a look at the MySQL storage provider to see an example.
This file is part of Snuze, a PHP client for the Reddit API. Copyright 2019 Shaun Cummiskey shaun @sha unc.c omhttps://shaunc.com/ Repository: https://github.com/snuze/snuze/ Documentation: https://snuze.shaunc.com/
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
http://www.apache.org/licenses/LICENSE-2.0
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.
snuze\Persistence\AbstractStorageProvider::getMapper | ( | string | $objectClass | ) |
Given the short class name of an object (e.g. 'AccessToken' or 'Link'), return a corresponding Mapper to handle that object, as implemented by this particular storage provider. If this storage provider hasn't implemented a Mapper for the requested type, an exception is thrown.
string | $objectClass | The short class name of the object a Mapper is desired for, e.g. 'Subreddit' or 'Link' |
Implements snuze\Persistence\Interfaces\StorageProviderInterface.
snuze\Persistence\AbstractStorageProvider::getRequiredExtensionNames | ( | ) |
Return the array of extensions this provider requires in order to operate properly.
Implements snuze\Persistence\Interfaces\StorageProviderInterface.
|
abstract |
Your storage provider must implement this method to perform whatever actions are necessary to initialize it; for example, opening a PDO connection, making sure certain data tables exist, etc.
Implements snuze\Persistence\Interfaces\StorageProviderInterface.