pfeifferNet

Collection
in package

AbstractYes

Provides post or recipe collection ids.

Tags
since
5.7.0
since
6.0.0

Make class singleton.

used-by
Featured_Recipes
used-by
Highest_Rated
used-by
Most_Viewed
used-by
User_Favourites

Table of Contents

Constants

TRANSIENT_EXPIRATION_DEBUG  = MINUTE_IN_SECONDS * 5
The transient expiration for debugging.
TRANSIENT_EXPIRATION_PRODUCTION  = WEEK_IN_SECONDS
The transient expiration for production
TRANSIENT_KEY  = ''
Collection members transient key.

Properties

$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$recipe  : Recipe
The instance of the recipe class.
$transient_expiration  : int
The transient expiration.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
get_post_ids()  : array<string|int, int>
Return the array of post ids for the collection.
get_recipe_ids()  : array<string|int, int>
Return the array of recipe ids for the collection.
rebuild_collection()  : array<string|int, int>|bool
Rebuild the array of collection post ids and set as transient.
__construct()  : void
Initialise the class and set its properties.

Constants

TRANSIENT_EXPIRATION_DEBUG

The transient expiration for debugging.

protected int TRANSIENT_EXPIRATION_DEBUG = MINUTE_IN_SECONDS * 5
Tags
since
6.0.0

TRANSIENT_EXPIRATION_PRODUCTION

The transient expiration for production

protected int TRANSIENT_EXPIRATION_PRODUCTION = WEEK_IN_SECONDS
Tags
since
6.0.0

TRANSIENT_KEY

Collection members transient key.

protected string TRANSIENT_KEY = ''
  • MUST override this in sub-classes.
Tags
since
6.0.0

Properties

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
6.0.0

$transient_expiration

The transient expiration.

protected int $transient_expiration
Tags
since
6.0.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
6.0.0
Return values
object

The instance of this class.

get_post_ids()

Return the array of post ids for the collection.

public get_post_ids() : array<string|int, int>
Tags
since
5.7.0
since
6.0.0

Simplify to improve inheritance.

Return values
array<string|int, int>

Array of post ids.

get_recipe_ids()

Return the array of recipe ids for the collection.

public get_recipe_ids() : array<string|int, int>
Tags
since
5.7.0
since
6.0.0

Simplify to improve inheritance.

uses
Recipe::get_post_ids_from_recipes()
Return values
array<string|int, int>

Array of recipe ids.

rebuild_collection()

Rebuild the array of collection post ids and set as transient.

public rebuild_collection() : array<string|int, int>|bool
  • MUST override this in child classes.
  • Return the array of post_ids.
Tags
since
6.0.0
since
6.7.0

Make method public to allow execution from cron job..

Return values
array<string|int, int>|bool

Array of post ids or false if no data

__construct()

Initialise the class and set its properties.

protected __construct() : void
Tags
since
5.7.0
uses
Recipe

        
On this page

Search results