self:is_type

Server

Checks whether the instance belongs to the specified type


Syntax

local result = self:is_type(
    name
)

Parameters

TypeNameDescription
stringnameType to check against

Returns

TypeNameDescription
boolresulttrue if the instance matches the given type, false otherwise

Examples

Check the type of a database instance
local entity = core.database.create("127.0.0.1", "root", "", "vital_sandbox")

core.engine.print("info", entity:is_type("database")) -- true
core.engine.print("info", entity:is_type("font")) -- false

On this page