10 defined(
'JPATH_PLATFORM') or die;
36 protected $typeAliasPattern = null;
63 $typeAlias = $params[
'typeAlias'];
65 $observer =
new self($observableObject);
67 $observer->contenthistoryHelper =
new JHelperContenthistory($typeAlias);
68 $observer->typeAliasPattern = $typeAlias;
82 public function onAfterStore(&$result)
86 $this->parseTypeAlias();
87 $aliasParts = explode(
'.', $this->contenthistoryHelper->typeAlias);
89 if (JComponentHelper::getParams($aliasParts[0])->
get(
'save_history', 0))
91 $this->contenthistoryHelper->store($this->table);
106 public function onBeforeDelete($pk)
108 $this->parseTypeAlias();
109 $aliasParts = explode(
'.', $this->contenthistoryHelper->typeAlias);
111 if (JComponentHelper::getParams($aliasParts[0])->
get(
'save_history', 0))
113 $this->parseTypeAlias();
114 $this->contenthistoryHelper->deleteHistory($this->table);
127 protected function parseTypeAlias()
130 static::$_myTableForPregreplaceOnly = $this->table;
132 $this->contenthistoryHelper->typeAlias = preg_replace_callback(
'/{([^}]+)}/',
137 $this->typeAliasPattern