SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/Subscribe.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace Sprout\Helpers;
  15.  
  16. /**
  17. * Base class for the content subscription handlers
  18. **/
  19. abstract class Subscribe {
  20.  
  21. /**
  22.   * Return a list of records for the provided settings
  23.   *
  24.   * @param array $handler_settings The settings provided when the user subscribed
  25.   * @param int $since The start timestamp for returned events
  26.   * @return array An array-of-arrays result set
  27.   *
  28.   * Each item in the list should be an array, with the following keys:
  29.   * name The name of the item
  30.   * text A short, plain-text description of the item
  31.   * url The URL to provide to the user. Can be absolute (http://...) or relative (/...)
  32.   * ts The event timestamp (unix format)
  33.   **/
  34. abstract public function getList(array $handler_settings, $since);
  35.  
  36.  
  37. /**
  38.   * Return a (string) name for this subscription.
  39.   * You can use the settings to tweak the title (e.g. the category of articles).
  40.   *
  41.   * @param array $handler_settings The settings provided when the user subscribed
  42.   * @return string An title shown to end users
  43.   **/
  44. abstract public function getName(array $handler_settings);
  45.  
  46. }
  47.  
  48.