Skip to main content

Zymba Documentation

Base

object @Base() {
construct() {}
callMethod(function $function, ...$arguments): mixed {}
clone(): object {}
countSlots(): int {}
getInternalID(): int {}
hasSlot(): bool {}
isInstanceOf(mixed $prototype): bool {}
listPrototypes(): object {}
listSlotNames(): object {}
listSlots(): object {}
setSlots(object $slots, string $prefix): $this {}
toJSON(): string {}
}

Base prototype.

Methods

Dummy fallback constructor function for ease of constructor chaining.

$this.construct(): void

Calls a function with variadic arguments, bound as a method to this object.

$this.callMethod(function $function, variadic $arguments): mixed
Parameters
NameTypeValueDefault
functionfunctionnull
argumentsvariadic...
Returns
TypeValue
mixed

Clones this object by creating a shallow copy.

$this.clone(): object
Returns
TypeValue
object

Counts the total number of slots within this object.

$this.countSlots(): int
Returns
TypeValue
int

Gets the unique internal identification number of this object.

$this.getInternalID(): int
Returns
TypeValue
int

Determines whether this object has a specific slot.

$this.hasSlot(): bool
Returns
TypeValue
bool

Determines whether this object is an instance of a specific prototype.

$this.isInstanceOf(mixed $prototype): bool
Parameters
NameTypeValueDefault
prototypemixednull
Returns
TypeValue
bool

Lists all prototypes of this object.

$this.listPrototypes(): object
Returns
TypeValue
object[prototype, ...]

Lists all slot names of this object.

$this.listSlotNames(): object
Returns
TypeValue
object[name, ...]

Lists all slots of this object.

$this.listSlots(): object
Returns
TypeValue
object[name: value, ...]

Sets multiple slots with slot names expanded by a specific prefix.

$this.setSlots(object $slots, string $prefix): this
Parameters
NameTypeValueDefault
slotsobject[name: value, ...][]
prefixstring""
Returns
TypeValue
$this

Returns the JavaScript Object Notation (JSON) representation of this object according to RFC 4627.

$this.toJSON(): string
Returns
TypeValue
string