PHP code example of hypejunction / hypestash
1. Go to this page and download the library: Download hypejunction/hypestash library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hypejunction / hypestash example snippets
elgg_get_total_likes($entity);
elgg_get_total_comments($entity);
// etc.
$stash = \hypeJunction\Stash\Stash::instance();
// Register a new cacheable property
$stash->register(new CustomProperty()); // Custom property must implement Preloader interface
// Get property value
$prop = $stash->get(CustomProperty::PROPERTY, $entity);