Class JTableObserverTags

Description

Abstract class defining methods that can be implemented by an Observer class of a JTable class (which is an Observable).

Attaches $this Observer to the $table in the constructor. The classes extending this class should not be instanciated directly, as they are automatically instanciated by the JObserverMapper

Located in /libraries/joomla/table/observer/tags.php (line 24)

JTableObserver
   |
   --JTableObserverTags
Variable Summary
Method Summary
 static JTableObserverTags createObserver (JObservableInterface $observableObject, [array $params = array()])
 void onAfterStore (boolean &$result)
 void onBeforeDelete (mixed $pk)
 void onBeforeStore (boolean $updateNulls, string $tableKey)
 void parseTypeAlias ()
 boolean setNewTags (array $newTags, boolean $replaceTags)
Variables
static JTableObserverTags $_myTableForPregreplaceOnly (line 67)

Not public, so marking private and deprecated, but needed internally in parseTypeAlias for PHP < 5.4.0 as it's not passing context $this to closure function.

  • deprecated: Never use this
  • private:
  • since: 3.1.2
  • access: public
array $newTags = false (line 48)

Override for postStoreProcess param newTags, Set by setNewTags, used by onAfterStore and onBeforeStore

  • since: 3.1.2
  • access: protected
boolean $replaceTags = true (line 56)

Override for postStoreProcess param replaceTags. Set by setNewTags, used by onAfterStore

  • since: 3.1.2
  • access: protected
JHelperTags $tagsHelper (line 32)

Helper object for managing tags

  • since: 3.1.2
  • access: protected
string $typeAliasPattern = null (line 40)

The pattern for this table's TypeAlias

  • since: 3.1.2
  • access: protected

Inherited Variables

Inherited from JTableObserver

JTableObserver::$table
Methods
static createObserver (line 81)

Creates the associated observer instance and attaches it to the $observableObject Creates the associated tags helper class instance $typeAlias can be of the form "{variableName}.type", automatically replacing {variableName} with table-instance variables variableName

  • since: 3.1.2
  • access: public
static JTableObserverTags createObserver (JObservableInterface $observableObject, [array $params = array()])
  • JObservableInterface $observableObject: The subject object to be observed
  • array $params: ( 'typeAlias' => $typeAlias )
onAfterStore (line 126)

Post-processor for $table->store($updateNulls) You can change optional params newTags and replaceTags of tagsHelper with method setNewTagsToAdd

  • since: 3.1.2
  • access: public
void onAfterStore (boolean &$result)
  • boolean &$result: The result of the load

Redefinition of:
JTableObserver::onAfterStore()
Post-processor for $table->store($updateNulls)
onBeforeDelete (line 154)

Pre-processor for $table->delete($pk)

  • since: 3.1.2
  • throws: UnexpectedValueException
  • access: public
void onBeforeDelete (mixed $pk)
  • mixed $pk: An optional primary key value to delete. If not set the instance property value is used.

Redefinition of:
JTableObserver::onBeforeDelete()
Pre-processor for $table->delete($pk)
onBeforeStore (line 103)

Pre-processor for $table->store($updateNulls)

  • since: 3.1.2
  • access: public
void onBeforeStore (boolean $updateNulls, string $tableKey)
  • boolean $updateNulls: The result of the load
  • string $tableKey: The key of the table

Redefinition of:
JTableObserver::onBeforeStore()
Pre-processor for $table->store($updateNulls)
parseTypeAlias (line 186)

Internal method Parses a TypeAlias of the form "{variableName}.type", replacing {variableName} with table-instance variables variableName Storing result into $this->tagsHelper->typeAlias

  • since: 3.1.2
  • access: protected
void parseTypeAlias ()
setNewTags (line 170)

Sets the new tags to be added or to replace existing tags

  • since: 3.1.2
  • access: public
boolean setNewTags (array $newTags, boolean $replaceTags)
  • array $newTags: New tags to be added to or replace current tags for an item
  • boolean $replaceTags: Replace tags (true) or add them (false)

Inherited Methods

Inherited From JTableObserver

 JTableObserver::__construct()
 JTableObserver::onAfterDelete()
 JTableObserver::onAfterLoad()
 JTableObserver::onAfterStore()
 JTableObserver::onBeforeDelete()
 JTableObserver::onBeforeLoad()
 JTableObserver::onBeforeStore()

Documentation generated on Tue, 19 Nov 2013 15:15:17 +0100 by phpDocumentor 1.4.3