/** * Hook for modules * * @param string $target Target * @param array $params Params * @param array $urlParts URL parts * * @return array */ protected function prepareBuildURL($target, $params, $urlParts) { return parent::prepareBuildURL('product_reviews' == $target ? 'product' : $target, $params, $urlParts); }
/** * Hook for modules * * @param string $url Main part of a clean URL * @param string $last First part before the "url" * @param string $rest Part before the "url" and "last" * @param string $ext Extension * @param string $target Target * @param array $params Additional params * * @return array */ protected function prepareParseURL($url, $last, $rest, $ext, $target, $params) { list($target, $params) = parent::prepareParseURL($url, $last, $rest, $ext, $target, $params); if ('page' == $target && !empty($last)) { unset($params['id']); } return array($target, $params); }
/** * Get entity * * @return \XLite\Model\AEntity */ public function getEntity() { $entity = null; foreach (\XLite\Model\Repo\CleanURL::getEntityTypes() as $type) { $method = 'get' . \XLite\Core\Converter::convertToCamelCase($type); if (method_exists($this, $method)) { $entity = $this->{$method}(); if ($entity) { break; } } } return $entity; }