Public Member Functions | |
retrieveOneFor (string $username) | |
purge (int $olderThan=86400) | |
Public Member Functions inherited from snuze\Persistence\Interfaces\MapperInterface | |
__construct (StorageProviderInterface $storage) | |
persist ($object) | |
retrieve ($key) | |
delete ($object) | |
The AccessTokenMapperInterface is part of the storage provider design.
It defines additional methods that must be implemented for persisting an AccessToken object, above and beyond the requirements in MapperInterface.
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\Interfaces\AccessTokenMapperInterface::purge | ( | int | $olderThan = 86400 | ) |
Implementers must expose a method to delete stale AccessToken objects from storage.
int | $olderThan | A number of seconds. The method should delete any AccessTokens that expired more than this many seconds ago. |
Implemented in snuze\Persistence\SQLite\AccessTokenMapper, and snuze\Persistence\MySQL\AccessTokenMapper.
snuze\Persistence\Interfaces\AccessTokenMapperInterface::retrieveOneFor | ( | string | $username | ) |
Implementers must expose a method to return the newest unexpired and valid AccessToken for a given user, if one exists.
string | $username | The username for whom to look for an AccessToken |
Implemented in snuze\Persistence\SQLite\AccessTokenMapper, and snuze\Persistence\MySQL\AccessTokenMapper.