10 defined(
'JPATH_PLATFORM') or die;
40 protected $typeAliasPattern = null;
48 protected $newTags =
false;
56 protected $replaceTags =
true;
83 $typeAlias = $params[
'typeAlias'];
85 $observer =
new self($observableObject);
87 $observer->tagsHelper =
new JHelperTags;
88 $observer->typeAliasPattern = $typeAlias;
103 public function onBeforeStore($updateNulls, $tableKey)
105 $this->parseTypeAlias();
106 if (empty($this->table->tagsHelper->tags))
108 $this->tagsHelper->preStoreProcess($this->table);
112 $this->tagsHelper->preStoreProcess($this->table, (array) $this->table->tagsHelper->tags);
126 public function onAfterStore(&$result)
130 if (empty($this->table->tagsHelper->tags))
132 $result = $this->tagsHelper->postStoreProcess($this->table);
136 $result = $this->tagsHelper->postStoreProcess($this->table, $this->table->tagsHelper->tags);
139 $this->newTags = array();
140 $this->replaceTags =
true;
154 public function onBeforeDelete($pk)
156 $this->parseTypeAlias();
157 $this->tagsHelper->deleteTagData($this->table, $pk);
170 public function setNewTags($newTags, $replaceTags)
172 $this->parseTypeAlias();
174 return $this->tagsHelper->postStoreProcess($this->table, $newTags, $replaceTags);
186 protected function parseTypeAlias()
189 static::$_myTableForPregreplaceOnly = $this->table;
191 $this->tagsHelper->typeAlias = preg_replace_callback(
'/{([^}]+)}/',
196 $this->typeAliasPattern