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

Public Member Functions

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

Detailed Description

The SubredditMapperInterface is part of the storage provider design.

It defines any additional methods that must be implemented for persisting a Subreddit 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\SubredditMapperInterface::retrieve (   $displayName)

Implementers must expose a retrieve() method that accepts a subreddit's display name (e.g. 'funny') and returns the Subreddit object, or null if the subreddit isn't persisted.

string$displayNameThe display name of the subreddit to retrieve

Implements snuze\Persistence\Interfaces\MapperInterface.

Implemented in snuze\Persistence\MySQL\SubredditMapper.

◆ retrieveById()

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

Implementers must expose a method to return a Subreddit by its internal Reddit "thing" ID, without "t5_" prepended, e.g. "2tlk9".

string$idThe subreddit's Reddit ID without "t5_" prepended

Implemented in snuze\Persistence\MySQL\SubredditMapper.

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