AfterPublishEvent

Extends BeforePublishEvent

Event class for JTable's onAfterPublish event

since

4.0.0

package

Joomla CMS

Methods

__construct

Constructor.

__construct( name, mixed||string|int arguments = []) : 
inherited

Mandatory arguments: subject JTableInterface The table we are operating on pks mixed An optional array of primary key values to update. state int The publishing state. eg. [0 = unpublished, 1 = published] userId int The user id of the user performing the operation.

throws

BadMethodCallException

Arguments

name

stringThe event name.

arguments

array<string|int, mixed>The event arguments.

Response

mixed

create

Creates a new CMS event object for a given event name and subject. The following arguments must be given: subject object The subject of the event. This is the core object you are going to manipulate.

create( eventName, mixed||string|int arguments = []) : 
inherited static

eventClass string The Event class name. If you do not provide it Joomla\CMS\Events<eventNameWithoutOnPrefix> will be used.

since

4.0.0

throws

BadMethodCallExceptionIf you do not provide a subject argument

Arguments

eventName

stringThe name of the event, e.g. onTableBeforeLoad

arguments

array<string|int, mixed>Additional arguments to pass to the event

Response

static

getArgument

Get an event argument value.

getArgument( name,  default = null) : 
inherited

It will use a pre-processing method if one exists. The method has the signature:

onGet<ArgumentName>($value): mixed

where:

$value is the value currently stored in the $arguments array of the event It returns the value to return to the caller.

since

4.0.0

Arguments

name

stringThe argument name.

default

mixedThe default value if not found.

Response

mixedThe argument value or the default value.

getEventClassByEventName

Get the concrete event class name for the given event name.

getEventClassByEventName( eventName) : 
inherited static

This method falls back to the generic Joomla\Event\Event class if the event name is unknown to this trait.

since

4.2.0

Arguments

eventName

stringThe event name

Response

stringThe event class name

offsetSet

Set the value of an event argument.

offsetSet( name,  value) : 
inherited
since

4.0.0

throws

BadMethodCallException

Arguments

name

stringThe argument name.

value

mixedThe argument value.

Response

void

offsetUnset

Remove an event argument.

offsetUnset( name) : 
inherited
since

4.0.0

throws

BadMethodCallException

Arguments

name

stringThe argument name.

Response

void

onSetQuery

Setter for the pks argument

onSetQuery(array|null value) : 
inherited
throws

BadMethodCallExceptionif the argument is not of the expected type

since

4.4.0

Arguments

value

array<string|int, mixed>|nullThe value to set

Response

mixed

onSetState

Setter for the state argument

onSetState( value) : 
inherited
throws

BadMethodCallExceptionif the argument is not of the expected type

since

4.4.0

Arguments

value

intThe value to set

Response

int

onSetSubject

Setter for the subject argument

onSetSubject(\Joomla\CMS\Table\TableInterface value) : \Joomla\CMS\Table\TableInterface
inherited
throws

BadMethodCallExceptionIf the argument is not of the expected type.

since

4.4.0

Arguments

value

TableInterfaceThe value to set

Response

TableInterface

onSetUserId

Setter for the userId argument

onSetUserId( value) : 
inherited
throws

BadMethodCallExceptionif the argument is not of the expected type

since

4.4.0

Arguments

value

intThe value to set

Response

int

setArgument

Add argument to event.

setArgument( name,  value) : 
inherited

It will use a pre-processing method if one exists. The method has the signature:

onSet<ArgumentName>($value): mixed

where:

$value is the value being set by the user It returns the value to return to set in the $arguments array of the event.

since

4.0.0

Arguments

name

stringArgument name.

value

mixedValue.

Response

$this

setQuery

Setter for the pks argument

setQuery(array|null value) : 
inherited deprecated
throws

BadMethodCallExceptionif the argument is not of the expected type

deprecated

4.4.0 will be removed in 6.0 Use counterpart with onSet prefix

Arguments

value

array<string|int, mixed>|nullThe value to set

Response

mixed

setState

Setter for the state argument

setState( value) : 
inherited deprecated
throws

BadMethodCallExceptionif the argument is not of the expected type

deprecated

4.4.0 will be removed in 6.0 Use counterpart with onSet prefix

Arguments

value

intThe value to set

Response

int

setSubject

Setter for the subject argument

setSubject(\Joomla\CMS\Table\TableInterface value) : \Joomla\CMS\Table\TableInterface
inherited deprecated
throws

BadMethodCallExceptionIf the argument is not of the expected type.

deprecated

4.4.0 will be removed in 6.0 Use counterpart with onSet prefix

Arguments

value

TableInterfaceThe value to set

Response

TableInterface

setUserId

Setter for the userId argument

setUserId( value) : 
inherited deprecated
throws

BadMethodCallExceptionif the argument is not of the expected type

deprecated

4.4.0 will be removed in 6.0 Use counterpart with onSet prefix

Arguments

value

intThe value to set

Response

int

Properties

eventNameToConcreteClass

Maps event names to concrete Event classes.

inherited static

This is only for events with invariable names. Events with variable names are handled with PHP logic in the getEventClassByEventName class.

since

4.2.0

Type(s)

array<string|int, mixed>

constructed

A flag to see if the constructor has been already called.

inherited
since

4.0.0

Type(s)

bool