tp TouchPointWP jsInstantiation - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\jsInstantiation

Used for client-side instantiation.

Note that classes that use this trait will likely also need to implement the JsonSerialize interface (implementation is provided here).


  • Full name: \tp\TouchPointWP\jsInstantiation

Methods

requireAllObjectsInJs

If all objects need to be included in the JS,

public static requireAllObjectsInJs(bool $require = true): void
  • This method is static. Parameters:
Parameter Type Description
$require bool Whether all objects should be required. Almost always should be left with the default.

jsonSerialize

Get the JS for instantiation.

public jsonSerialize(): object

getTouchPointId

Gets a TouchPoint item ID number, regardless of what type of object this is.

public getTouchPointId(): int
  • This method is abstract.

getJsInstantiationString

Get the JS for instantiation.

public static getJsInstantiationString(): string
  • This method is static.* This method is abstract.