39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
|
|
*
|
|
* @author Jpresta
|
|
* @copyright Jpresta
|
|
* @license See the license of this module in file LICENSE.txt, thank you.
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_'))
|
|
exit;
|
|
|
|
/**
|
|
* Implements getJprestaModelObjectClassName() and getJprestaModelObjectId() to enable the HTML cache provided by the
|
|
* module Page Cache Ultimate created by jpresta.com
|
|
*/
|
|
class Ybc_blogBlogModuleFrontControllerOverride extends Ybc_blogBlogModuleFrontController
|
|
{
|
|
/**
|
|
* @return string The ObjectModel class name to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
|
|
*/
|
|
public static function getJprestaModelObjectClassName()
|
|
{
|
|
return 'Ybc_blog_post_class';
|
|
}
|
|
|
|
/**
|
|
* @return int|null The ID of the current ObjectModel (if any) to be used by Page Cache Ultimate module to refresh the cache of pages generated by this controller
|
|
*/
|
|
public function getJprestaModelObjectId()
|
|
{
|
|
$id_post = (int)Tools::getValue('id_post');
|
|
if (!$id_post && ($post_url_alias = Tools::getValue('post_url_alias')) && Validate::isLinkRewrite($post_url_alias)) {
|
|
$id_post = (int)Ybc_blog_post_class::getIDPostByUrlAlias($post_url_alias, $this->context->language->id);
|
|
}
|
|
return $id_post;
|
|
}
|
|
}
|