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

Public Member Functions

 retrieve ($username)
 retrieveById (string $id)
- Public Member Functions inherited from snuze\Persistence\Interfaces\MapperInterface
 __construct (StorageProviderInterface $storage)
 persist ($object)
 delete ($object)

Detailed Description

The AccountMapperInterface is part of the storage provider design.

It defines any additional methods that must be implemented for persisting an Account subtype 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 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.

Member Function Documentation

◆ retrieve()

snuze\Persistence\Interfaces\AccountMapperInterface::retrieve (   $username)

Implementers must expose a retrieve() method that accepts an account's username and returns a UserAccount object, or null if the account isn't persisted.

string$usernameThe username of the account to retrieve

Implements snuze\Persistence\Interfaces\MapperInterface.

Implemented in snuze\Persistence\MySQL\AccountMapper.

◆ retrieveById()

snuze\Persistence\Interfaces\AccountMapperInterface::retrieveById ( string  $id)

Implementers must expose a method to return an account by its internal Reddit "thing" ID, without "t2_" prepended, e.g. "bva2".

string$idThe account's Reddit ID without "t2_" prepended

Implemented in snuze\Persistence\MySQL\AccountMapper.

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