\JTableObserverTags
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
Synopsis
class JTableObserverTags
extends JTableObserver
{
- // members
- protected JHelperTags $tagsHelper;
- protected $typeAliasPattern;
- protected $newTags;
- protected $replaceTags;
- public JTableObserverTags $_myTableForPregreplaceOnly;
- // Inherited members from JTableObserver
- protected JTable $table;
- // methods
- public static JTableObserverTags createObserver()
- public void onBeforeStore()
- public void onAfterStore()
- public void onBeforeDelete()
- public boolean setNewTags()
- protected void parseTypeAlias()
- // Inherited methods from JTableObserver
- public void __construct()
- public void onBeforeLoad()
- public void onAfterLoad()
- public void onBeforeStore()
- public void onAfterStore()
- public void onBeforeDelete()
- public void onAfterDelete()
Hierarchy
Extends
Members
protected
- $newTags
—
array
Override for postStoreProcess param newTags, Set by setNewTags, used by onAfterStore and onBeforeStore - $replaceTags
—
boolean
Override for postStoreProcess param replaceTags. Set by setNewTags, used by onAfterStore - $table
—
JTable
The observed table - $typeAliasPattern
—
string
The pattern for this table's TypeAlias
public
- $_myTableForPregreplaceOnly
—
JTableObserverTags
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.
Methods
protected
- parseTypeAlias() — Internal method Parses a TypeAlias of the form "{variableName}.type", replacing {variableName} with table-instance variables variableName Storing result into $this->tagsHelper->typeAlias
public
- createObserver() — 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
- onAfterStore() — Post-processor for $table->store($updateNulls) You can change optional params newTags and replaceTags of tagsHelper with method setNewTagsToAdd
- onBeforeDelete() — Pre-processor for $table->delete($pk)
- onBeforeStore() — Pre-processor for $table->store($updateNulls)
- setNewTags() — Sets the new tags to be added or to replace existing tags
Inherited from JTableObserver
public
- onAfterDelete() — Post-processor for $table->delete($pk)
- onAfterLoad() — Post-processor for $table->load($keys, $reset)
- onAfterStore() — Post-processor for $table->store($updateNulls)
- onBeforeDelete() — Pre-processor for $table->delete($pk)
- onBeforeLoad() — Pre-processor for $table->load($keys, $reset)
- onBeforeStore() — Pre-processor for $table->store($updateNulls)