Tags

Extends AbstractObserver

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

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

since

3.1.2

package

Joomla CMS

Methods

__construct

Constructor: Associates to $table $this observer

__construct(\Joomla\CMS\Table\TableInterface table) : mixed
inherited
since

3.1.2

Arguments

table

\Joomla\CMS\Table\TableInterfaceTable to be observed

Response

mixed

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

createObserver(\JObservableInterface observableObject, array params = array()) : \Joomla\CMS\Table\Observer\Tags
static
since

3.1.2

Arguments

observableObject

\JObservableInterfaceThe subject object to be observed

params

array( 'typeAlias' => $typeAlias )

Response

\Joomla\CMS\Table\Observer\Tags

onAfterDelete

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

onAfterDelete(mixed pk) : void
inherited
since

3.1.2

Arguments

pk

mixedThe deleted primary key value.

onAfterLoad

Post-processor for $table->load($keys, $reset)

onAfterLoad(bool &result, array row) : void
inherited
since

3.1.2

Arguments

result

boolThe result of the load

row

arrayThe loaded (and already binded to $this->table) row of the database table

onAfterStore

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

onAfterStore(bool &result) : void
inherited
since

3.1.2

Arguments

result

boolThe result of the store

onBeforeDelete

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

onBeforeDelete(mixed pk) : void
inherited
since

3.1.2

throws

\UnexpectedValueException

Arguments

pk

mixedAn optional primary key value to delete. If not set the instance property value is used.

onBeforeLoad

Pre-processor for $table->load($keys, $reset)

onBeforeLoad(mixed keys, bool reset) : void
inherited
since

3.1.2

Arguments

keys

mixedAn optional primary key value to load the row by, or an array of fields to match. If not set the instance property value is used.

reset

boolTrue to reset the default values before loading the new row.

onBeforeStore

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

onBeforeStore(bool updateNulls, string tableKey) : void
inherited
since

3.1.2

Arguments

updateNulls

boolThe result of the load

tableKey

stringThe key of the table

parseTypeAlias

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

parseTypeAlias() : void
since

3.1.2

setNewTags

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

setNewTags(array newTags, bool replaceTags) : bool
since

3.1.2

Arguments

newTags

arrayNew tags to be added to or replace current tags for an item

replaceTags

boolReplace tags (true) or add them (false)

Response

bool

Properties

tagsHelper

Helper object for managing tags

since

3.1.2

Type(s)

\JHelperTags

typeAliasPattern

The pattern for this table's TypeAlias

since

3.1.2

Type(s)

string

newTags

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

since

3.1.2

Type(s)

array

replaceTags

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

since

3.1.2

Type(s)

bool

_myTableForPregreplaceOnly

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.

static deprecated
since

3.1.2

deprecated

Never use this

private

Type(s)

\Joomla\CMS\Table\Observer\Tags

table

The observed table

inherited
since

3.1.2

Type(s)

\Joomla\CMS\Table\Table