Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Object.zSetField

zSetField($fieldName, $value) -> self

Description

Set the given field to the given value.

Note: New fields can only be created in the new constructor method.

class MyClass {
    fun set($color) {
        @.xSetField('color', $color)
        print(@.color)
    }
}

//------ another file ------

$c = MyClass()

$c.zSetField('color', 'green', 'PRIVATE')

See Also