Documentation

Script extends Node
in package

Scripts can be attached to types or instances, used for displaying reports, calculating KPI's, and more

The core languages supported are php, python, SQL, and client side JS and CSS (this list will grow!). Scripts can be headless, browser, display, or class scripts. Headless scripts are used to run tasks in a scheduled manner, act as endpoints for other scripts and postprocess data. Browser scripts are PHP scripts that also contain JS and CSS which are used to create reports and dashboards. Display scripts are similar to Browser scripts, but are the default displays for types. Class scripts give behavior to types and allow methods and interfaces to be attached to objects.

Table of Contents

Constants

EDIT_STATUS  = [0 => '', 1 => 'In Work', 2 => 'In Review', 3 => 'Approved', 4 => 'Done']
EDIT_STATUS
TABLE_TO_CLASS  = ['attributes' => 'Attribute', 'attribute_types' => 'AttributeType', 'connectors' => 'Connector', 'enumeration_types' => 'EnumerationType', 'equipment' => 'Equipment', 'equipment_types' => 'EquipmentType', 'gateways' => 'Gateway', 'objects' => 'GenericObject', 'libraries' => 'Library', 'limits' => 'Limit', 'materials' => 'Material', 'measurement_units' => 'MeasurementUnit', 'opc_groups' => 'OpcGroup', 'opcua_objects' => 'OpcuaObject', 'organizations' => 'Organization', 'persons' => 'GenericObject', 'places' => 'Place', 'quantities' => 'QuantityKind', 'relationships' => 'Relationship', 'relationship_types' => 'RelationshipType', 'scripts' => 'Script', 'tags' => 'Tag', 'types' => 'Type', 'type_to_attribute_types' => 'TypeToAttributeType', 'type_to_child_types' => 'TypeToChildType']

Properties

$account  : Account|null
$attributes  : array<string|int, mixed>
$children  : array<string|int, mixed>
$description  : string
$display_name  : string
$error_message  : string
$fqn  : string
$id  : string
$is_class_script  : bool
$nodes  : array<string|int, mixed>
$parent  : Node|null
$relationshipsDown  : array<string|int, mixed>
$relationshipsUp  : array<string|int, mixed>
$scripts  : array<string|int, mixed>
$totalAttributes  : int|null
$totalScripts  : int|null
$type_name  : string
$access_group_ids  : array<string|int, mixed>|null
$allowed_props  : array<string|int, mixed>
$called_constructor  : bool
$class_script  : Script|null
$created_timestamp  : string|null
$cron_expression  : string|null
$display_path  : string|null
$display_scripts  : array<string|int, mixed>
$document  : string|null
$edit_status  : string|null
$id_path  : string|null
$importance  : float|null
$initial_inputs  : string|null
$is_root  : bool|null
$library  : Library|null
$max_acceptable_run_secs  : int|null
$operating_table  : string
$output_type  : string|null
$parent_type  : string|null
$part_of_id  : int|null
$prop_types  : array<string|int, mixed>
$relationship  : mixed|Relationship
$relationship_id  : int|null
$relative_name  : string|null
$run  : bool|null
$schema  : string
$script  : string|null
$script_ext  : string|null
$script_file_name  : string|null
$script_type  : string
$scripts_folder  : string
$system_node_type  : SystemNodeType|null
$system_node_type_id  : int|null
$type  : Type|null
$type_id  : int|null
$unlink_relative_name  : bool|null
$unsaved_props  : array<string|int, mixed>
$updated_timestamp  : string|null
$use_outputs_from_last_run  : bool|null

Methods

__construct()  : mixed
Node constructor.
__debugInfo()  : array<string|int, mixed>|null
Magic Method called by functions like var_dump and print_r. We prune the object before emitting.
__get()  : mixed
If the property is an attribute, then return the attribute object.
__isset()  : bool
Magic hook that methods like empty() and isset() call this method. Without this method code like: `if(empty($node->attr->max_value))` will always be empty, as the properties are protected.
__set()  : void
Set a property for this node, the value will not be saved until the 'save' method is called.
__toString()  : string
Called during a print/echo statement, this function returns a html table of all the attributes of the Node, minus the DatabaseTrait properties.
checkIfClassScript()  : bool
set the is_class_script property
configErrorMessage()  : string
Returns the configuration error message.
delete()  : void
Handles the removal of the script from the Disk and Cleans up Scripts and other dependant items.
findNodesByTypes()  : array<string|int, mixed>
Searches down the id path to find any node of the given type (display name or relative name) If depth is set, the search will only go down that many levels
findObjectByType()  : array<string|int, mixed>
Searches each of the children and if the specify object type is not found, it goes up one level and does a recursion to search the children higher up until we don't have any more parents to search into.
generateRelativeName()  : string
Gets the `generate_relative_name_from_display_name`.
getAccount()  : Account|null
Gets the account information for the given Node
getAllowedProps()  : array<string|int, mixed>
Get the allowed properties for this Node Return an array intersection of the Class Properties and Table Columns.
getAttributeCount()  : $this
Gets the total attribute count of the given node.
getAttributes()  : $this
Queries attributes for a given node add attaches it to the node object.
getChildren()  : $this
getConfig()  : TiqConfig
Gets the TIQ configuration.
getDb()  : PgSQL
Gets database instance.
getDisplayScripts()  : Node
Gets the Display scripts associate to this node, will search inheritance path as well as type
getFQN()  : string
Returns a human-readable FQN.
getFQNDisplayPath()  : array<string|int, mixed>|array<string|int, string>
This is a bulk call of the function getFQN for multiple nodes.
getIdFromFileName()  : string
extracts ID from [relative_name]_[ID].[file_extension]
getInstance()  : Node
Gets current instance of the Node.
getLibrary()  : Library|null
Returns the Library of the given node
getNodeId()  : int
Return the ID from and FQN
getNodeSet()  : array<string|int, mixed>
Returns a list of all nodes that are for type $identifier to get the type name use "SELECT * FROM model.system_node_types".
getOperatingTable()  : string
Returns the current operating table.
getParent()  : $this
This function fetches all the nodes one level up.
getRelationshipsDown()  : Node
Gets all direct children nodes.
getRelationshipsUp()  : Node
Gets all direct parent nodes.
getScripts()  : Node
Gets the scripts associate to this node.
getSystemType()  : Node
Sets the system type name of the given attribute.
getTaxonomySystemNodeTypeId()  : int
Gets the Taxonomy System Node Type ID.
getTemplate()  : Script
Return template.
getTemplates()  : mixed
Returns all templates.
getType()  : Type|null
sets a Type model based on the current type_id.
hasClassScript()  : bool
Checks all the nodes' script to see if there is a class script.
include()  : void
includeScript()  : bool
Acts as a 'include_once' for a script based on an FQN.
isDebug()  : bool
Is debug mode or not.
jsonSerialize()  : array<string|int, mixed>
Typically used to create a structure that js can turn into an object in the browser minus the DatabaseTrait properties.
JSONSerializeRecord()  : array<string|int, mixed>
Returns an array that can can easily be json_encoded
reduceFQN()  : array<string|int, string>
Handles to reduce the FQN paths to help the UI for the client.
save()  : void
writes updated properties into the database, or creates it if it does not exist.
saveScript()  : void
Saves a script on disk.
convertPostgresTypeArray()  : array<string|int, mixed>
Take a postgres typed array and converts it to a php array e.g. {"test 1","test 2"} from postgres will yield ["test 1", "test 2"]
deleteScriptFromDisk()  : void
Handles script removal from the disk.
getTypeName()  : string
Gets the Type Name.
saveToDisk()  : void
Save a file on disk with specific permissions
setProps()  : void
Loads all database columns as static variables. To load a variable, it must exist in the class.

Constants

EDIT_STATUS

EDIT_STATUS

public mixed EDIT_STATUS = [0 => '', 1 => 'In Work', 2 => 'In Review', 3 => 'Approved', 4 => 'Done']

TABLE_TO_CLASS

public mixed TABLE_TO_CLASS = ['attributes' => 'Attribute', 'attribute_types' => 'AttributeType', 'connectors' => 'Connector', 'enumeration_types' => 'EnumerationType', 'equipment' => 'Equipment', 'equipment_types' => 'EquipmentType', 'gateways' => 'Gateway', 'objects' => 'GenericObject', 'libraries' => 'Library', 'limits' => 'Limit', 'materials' => 'Material', 'measurement_units' => 'MeasurementUnit', 'opc_groups' => 'OpcGroup', 'opcua_objects' => 'OpcuaObject', 'organizations' => 'Organization', 'persons' => 'GenericObject', 'places' => 'Place', 'quantities' => 'QuantityKind', 'relationships' => 'Relationship', 'relationship_types' => 'RelationshipType', 'scripts' => 'Script', 'tags' => 'Tag', 'types' => 'Type', 'type_to_attribute_types' => 'TypeToAttributeType', 'type_to_child_types' => 'TypeToChildType']

Properties

$attributes

public array<string|int, mixed> $attributes = []

$children

public array<string|int, mixed> $children = []

$description

public string $description

$display_name

public string $display_name

$error_message

public static string $error_message = 'An issue occurred, please contact ThinkIQ for Support and enable debugging'
  • Base error message

$is_class_script

public bool $is_class_script = false

$nodes

public array<string|int, mixed> $nodes = []

$relationshipsDown

public array<string|int, mixed> $relationshipsDown = []

$relationshipsUp

public array<string|int, mixed> $relationshipsUp = []

$scripts

public array<string|int, mixed> $scripts = []

$totalAttributes

public int|null $totalAttributes = null

$totalScripts

public int|null $totalScripts = null

$type_name

public string $type_name

$access_group_ids

protected array<string|int, mixed>|null $access_group_ids = null

$called_constructor

protected bool $called_constructor = false

$class_script

protected Script|null $class_script = null

$created_timestamp

protected string|null $created_timestamp = null

$cron_expression

protected string|null $cron_expression = null

$display_path

protected string|null $display_path = null

$display_scripts

protected array<string|int, mixed> $display_scripts = []

$document

protected string|null $document = null

$edit_status

protected string|null $edit_status = null

$id_path

protected string|null $id_path = ''

$importance

protected float|null $importance = null

$initial_inputs

protected string|null $initial_inputs = null

$is_root

protected bool|null $is_root = null

$max_acceptable_run_secs

protected int|null $max_acceptable_run_secs = null

$operating_table

protected string $operating_table = 'scripts'

$output_type

protected string|null $output_type = null

$parent_type

protected string|null $parent_type = null

$part_of_id

protected int|null $part_of_id = null

$relationship_id

protected int|null $relationship_id = null

$relative_name

protected string|null $relative_name = null

$run

protected bool|null $run = null

$schema

protected string $schema = 'model'

$script

protected string|null $script = null

$script_ext

protected string|null $script_ext = null

$script_file_name

protected string|null $script_file_name = null

$script_type

protected string $script_type = ''

$scripts_folder

protected string $scripts_folder = ''

$system_node_type_id

protected int|null $system_node_type_id = null

$type_id

protected int|null $type_id = null
protected bool|null $unlink_relative_name = null

$updated_timestamp

protected string|null $updated_timestamp = null

$use_outputs_from_last_run

protected bool|null $use_outputs_from_last_run = null

Methods

__construct()

Node constructor.

public __construct([string|int|null $identifier = null ][, array<string|int, mixed> $config = [] ][, array<string|int, mixed> $additionalMethods = [] ]) : mixed
Parameters
$identifier : string|int|null = null
  • FQN or ID
$config : array<string|int, mixed> = []
  • This array contains the same properties as a record from the corresponding table in the database
$additionalMethods : array<string|int, mixed> = []
  • Methods to be call when we initiate the class.
Tags
throws
Exception

__debugInfo()

Magic Method called by functions like var_dump and print_r. We prune the object before emitting.

public __debugInfo() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

__get()

If the property is an attribute, then return the attribute object.

public __get(mixed $name) : mixed
Parameters
$name : mixed
  • The name of the attribute we want to get.

__isset()

Magic hook that methods like empty() and isset() call this method. Without this method code like: `if(empty($node->attr->max_value))` will always be empty, as the properties are protected.

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

__set()

Set a property for this node, the value will not be saved until the 'save' method is called.

public __set(string $prop, mixed $value) : void
Parameters
$prop : string
  • The property we want to set.
$value : mixed
  • The value we want to set into the property.

__toString()

Called during a print/echo statement, this function returns a html table of all the attributes of the Node, minus the DatabaseTrait properties.

public __toString() : string
Return values
string

checkIfClassScript()

set the is_class_script property

public checkIfClassScript() : bool
Return values
bool

configErrorMessage()

Returns the configuration error message.

public static configErrorMessage() : string
Return values
string

delete()

Handles the removal of the script from the Disk and Cleans up Scripts and other dependant items.

public delete() : void
Tags
throws
Exception

findNodesByTypes()

Searches down the id path to find any node of the given type (display name or relative name) If depth is set, the search will only go down that many levels

public findNodesByTypes(string $types[, int|null $depth = null ]) : array<string|int, mixed>
Parameters
$types : string
$depth : int|null = null
Tags
throws
Exception
Return values
array<string|int, mixed>

findObjectByType()

Searches each of the children and if the specify object type is not found, it goes up one level and does a recursion to search the children higher up until we don't have any more parents to search into.

public findObjectByType(string|array<string|int, int> $ids, string $objectType[, bool $returnFirst = false ][, array<string|int, mixed> $memoize = [] ][, array<string|int, mixed> $objects = [] ]) : array<string|int, mixed>
Parameters
$ids : string|array<string|int, int>
  • node_ids we are going to be searching.
$objectType : string
  • The type of object we are searching in the tree.
$returnFirst : bool = false
  • If set to True, it will return only the first found node in the tree
$memoize : array<string|int, mixed> = []
  • Stores the ids that we have traverse in order to speed up the recursive call.
$objects : array<string|int, mixed> = []
  • Stores unique objects.
Tags
throws
Exception
Return values
array<string|int, mixed>
  • an array of objects that contains the type of Object we were searching for.

generateRelativeName()

Gets the `generate_relative_name_from_display_name`.

public static generateRelativeName(string $displayName[, string|null $typeName = null ][, int|null $partOfId = null ][, int|null $nodeId = null ]) : string
Parameters
$displayName : string
  • The display name we are searching.
$typeName : string|null = null
  • The type name we are searching.
$partOfId : int|null = null
  • The part of ID we are searching.
$nodeId : int|null = null
  • The Node ID that we are searching.
Return values
string

getAccount()

Gets the account information for the given Node

public getAccount([array<string|int, mixed>|null $additionalMethods = [] ]) : Account|null
Parameters
$additionalMethods : array<string|int, mixed>|null = []
Tags
throws
Exception
Return values
Account|null

getAllowedProps()

Get the allowed properties for this Node Return an array intersection of the Class Properties and Table Columns.

public getAllowedProps() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAttributeCount()

Gets the total attribute count of the given node.

public getAttributeCount([string|null $search_params = null ][, bool $deep_search = false ][, bool $show_hidden_attributes = true ]) : $this
Parameters
$search_params : string|null = null

This parameter is a JSON object.

$deep_search : bool = false

This toggles the ability to search not only immediate children but children of children.

$show_hidden_attributes : bool = true

Enable or disable hidden attributes.

Return values
$this

getAttributes()

Queries attributes for a given node add attaches it to the node object.

public getAttributes([string $column = 'display_name' ][, string $order = 'ASC' ][, int|null $limit = null ][, int|null $offset = null ][, string|null $search_params = null ][, bool $deep_search = false ][, false $show_hidden_attributes = true ][, string $default_selected_ids = "" ][, bool $lazy_load = false ]) : $this
Parameters
$column : string = 'display_name'

This is the name of the column we order by.

$order : string = 'ASC'

ASC or DESC order.

$limit : int|null = null

The amount of rows we want to limit.

$offset : int|null = null

Dictates the number of rows to skip from the beginning of the returned data before presenting the results.

$search_params : string|null = null

This parameter is a JSON object.

$deep_search : bool = false

This toggles the ability to search not only immediate children but children of children.

$show_hidden_attributes : false = true

Enable or disable hidden attributes.

$default_selected_ids : string = ""

to display attributes at the top of the list.

$lazy_load : bool = false
Tags
throws
Exception
Return values
$this

getChildren()

public getChildren([array<string|int, mixed> $additionalMethods = [] ]) : $this
Parameters
$additionalMethods : array<string|int, mixed> = []
  • Methods to be call to call when we initiate the class.
Tags
todo:

pass types in function definition instead of excluding hardcoded types

This function fetches all the nodes one level down.

throws
Exception
Return values
$this

getConfig()

Gets the TIQ configuration.

public static getConfig() : TiqConfig
Return values
TiqConfig

getDb()

Gets database instance.

public static getDb() : PgSQL

The database connection is stored in a static property within the DatabaseConnectionManager class, ensuring that it is truly a singleton across the entire application, regardless of which class calls this method.

Return values
PgSQL

getDisplayScripts()

Gets the Display scripts associate to this node, will search inheritance path as well as type

public getDisplayScripts() : Node
Tags
throws
Exception
Return values
Node

getFQN()

Returns a human-readable FQN.

public getFQN([string $delimiter = '.' ][, bool $use_display_names = false ]) : string
Parameters
$delimiter : string = '.'

Optional parameter to separate the relative names.

$use_display_names : bool = false

Optional parameter to return display names instead of relative names.

Tags
throws
Exception
Return values
string

getFQNDisplayPath()

This is a bulk call of the function getFQN for multiple nodes.

public static getFQNDisplayPath(array<string|int, string>|array<string|int, int>|array<string|int, mixed> $ids[, string $delimiter = '.' ][, bool $reduce = true ]) : array<string|int, mixed>|array<string|int, string>
Parameters
$ids : array<string|int, string>|array<string|int, int>|array<string|int, mixed>

Array of Node ids.

$delimiter : string = '.'

Optional parameter to separate the relative names.

$reduce : bool = true

Dictates whether to reduce the Node path or not,

Return values
array<string|int, mixed>|array<string|int, string>

getIdFromFileName()

extracts ID from [relative_name]_[ID].[file_extension]

public static getIdFromFileName(string $script_file_name) : string

take something like my_script_for_something_31412.php and return 31412 flow: [relative_name][ID].[file_extension] => [relative_name][ID] => [ID]

Parameters
$script_file_name : string
  • The file name.
Return values
string

getInstance()

Gets current instance of the Node.

public static getInstance(mixed $identifier[, array<string|int, mixed>|null $config = [] ]) : Node
Parameters
$identifier : mixed
  • FQN or ID.
$config : array<string|int, mixed>|null = []
  • This array contains the same properties as a record from the corresponding table in the database.
Tags
throws
Exception
Return values
Node

getLibrary()

Returns the Library of the given node

public getLibrary() : Library|null
Tags
throws
Exception
Return values
Library|null

getNodeId()

Return the ID from and FQN

public static getNodeId(string|int $identifier) : int
Parameters
$identifier : string|int
  • FQN or ID
Tags
throws
Exception
Return values
int

getNodeSet()

Returns a list of all nodes that are for type $identifier to get the type name use "SELECT * FROM model.system_node_types".

public static getNodeSet(string $identifier[, string $column = 'display_name' ][, string $order = 'ASC' ][, int|null $limit = null ][, int|null $offset = null ][, string|null $search_params = null ][, string $default_selected_ids = "" ][, bool|null $deep_search = false ][, array<string|int, mixed> $additionalMethods = [] ]) : array<string|int, mixed>
Parameters
$identifier : string
  • type_name or ID.
$column : string = 'display_name'
  • the column we are selecting.
$order : string = 'ASC'
  • the order we are going to be returning the records.
$limit : int|null = null
  • limits the records return.
$offset : int|null = null
  • dictates the number of rows to skip from the beginning of the returned data before presenting the results.
$search_params : string|null = null
  • the values we are searching for.
$default_selected_ids : string = ""
  • to display attributes at the top of the list.
$deep_search : bool|null = false
  • This toggles the ability to search not only immediate children but children of children.
$additionalMethods : array<string|int, mixed> = []
  • Additional methods.
Tags
throws
Exception
Return values
array<string|int, mixed>

getOperatingTable()

Returns the current operating table.

public getOperatingTable() : string
Return values
string

getParent()

This function fetches all the nodes one level up.

public getParent([array<string|int, mixed> $additionalMethods = [] ]) : $this
Parameters
$additionalMethods : array<string|int, mixed> = []
  • Methods to be call to call when we initiate the class.
Tags
throws
Exception
Return values
$this

getRelationshipsDown()

Gets all direct children nodes.

public getRelationshipsDown() : Node
Tags
throws
Exception
Return values
Node

getRelationshipsUp()

Gets all direct parent nodes.

public getRelationshipsUp() : Node
Tags
throws
Exception
Return values
Node

getScripts()

Gets the scripts associate to this node.

public getScripts([bool $deep_search = false ]) : Node
Parameters
$deep_search : bool = false
Tags
throws
Exception
Return values
Node

getSystemType()

Sets the system type name of the given attribute.

public getSystemType() : Node
Return values
Node

getTaxonomySystemNodeTypeId()

Gets the Taxonomy System Node Type ID.

public static getTaxonomySystemNodeTypeId(string|int $id) : int
Parameters
$id : string|int

FQN or ID

Return values
int

getTemplate()

Return template.

public static getTemplate(string|int|Script $identifier) : Script
Parameters
$identifier : string|int|Script
Tags
throws
Exception
Return values
Script
  • Instance of the script class or int|string id.

getTemplates()

Returns all templates.

public static getTemplates() : mixed

getType()

sets a Type model based on the current type_id.

public getType() : Type|null
Tags
throws
Exception
Return values
Type|null

hasClassScript()

Checks all the nodes' script to see if there is a class script.

public hasClassScript() : bool
Tags
throws
Exception
Return values
bool

include()

public include() : void
Tags
throws
Exception

includeScript()

Acts as a 'include_once' for a script based on an FQN.

public static includeScript(string|int|Script $identifier[, null $node_id = null ]) : bool

Note that this is checking the file system, so even though a script may be declared in the database, that does not mean it has been saved to the file system yet.

Parameters
$identifier : string|int|Script
  • This can also be the id of the script, fqn, or object. The intent is for an FQN to be used.
$node_id : null = null
  • This is the instance the script is running on
Tags
throws
Exception
Return values
bool

isDebug()

Is debug mode or not.

public static isDebug() : bool
Return values
bool

jsonSerialize()

Typically used to create a structure that js can turn into an object in the browser minus the DatabaseTrait properties.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

JSONSerializeRecord()

Returns an array that can can easily be json_encoded

public JSONSerializeRecord() : array<string|int, mixed>
Return values
array<string|int, mixed>

reduceFQN()

Handles to reduce the FQN paths to help the UI for the client.

public static reduceFQN(array<string|int, mixed> $paths[, string $delimiter = '.' ]) : array<string|int, string>
Parameters
$paths : array<string|int, mixed>

A multidimensional array that contains paths and ids we want to reduce.

$delimiter : string = '.'

Optional parameter to separate the relative names.

Return values
array<string|int, string>

save()

writes updated properties into the database, or creates it if it does not exist.

public save() : void
Tags
throws
PDOException
throws
Exception

saveScript()

Saves a script on disk.

public static saveScript(string $script_file_name[, string $scripts_folder = '' ][, bool $force_write = false ]) : void
  1. Make sure the script exists in the database, if no delete from disk
  2. Script is in DB, create on disk
Parameters
$script_file_name : string
  • The script name.
$scripts_folder : string = ''
  • The folder were we want to persist the script.
$force_write : bool = false
Tags
throws
Exception

convertPostgresTypeArray()

Take a postgres typed array and converts it to a php array e.g. {"test 1","test 2"} from postgres will yield ["test 1", "test 2"]

protected convertPostgresTypeArray(string|null $data[, string $type_hint = 'string' ]) : array<string|int, mixed>
Parameters
$data : string|null
  • The postgres typed array.
$type_hint : string = 'string'
Tags
throws
Exception
Return values
array<string|int, mixed>

deleteScriptFromDisk()

Handles script removal from the disk.

protected static deleteScriptFromDisk(Script|string $script) : void
Parameters
$script : Script|string
  • The Script class instance.
Tags
throws
Exception

getTypeName()

Gets the Type Name.

protected getTypeName() : string
Return values
string

saveToDisk()

Save a file on disk with specific permissions

protected static saveToDisk(string $script_file_name, string $content[, bool $force_write = false ]) : void
Parameters
$script_file_name : string
  • The name of the script.
$content : string
  • The data to write to the script.
$force_write : bool = false
  • Write the file even if it already exists
Tags
throws
Exception

setProps()

Loads all database columns as static variables. To load a variable, it must exist in the class.

protected setProps([array<string|int, mixed> $config = [] ][, array<string|int, mixed> $additionalMethods = [] ]) : void

If the 'id' property is not set, we still run this function, populating the $allowed_props variable.

Parameters
$config : array<string|int, mixed> = []
  • This array contains the same properties as a record from the corresponding table in the database.
$additionalMethods : array<string|int, mixed> = []
  • Methods to be call to call when we initiate the class.

        
On this page

Search results