Documentation

RoomCreateFeaturesBuilder
in package

A builder class to create RoomCreateFeatures objects from an array.

This class simplifies the process of creating complex RoomCreateFeatures objects by allowing you to pass a simple associative array of settings.

Table of Contents

Properties

$roomMetadata  : array<string|int, mixed>

Methods

__construct()  : mixed
build()  : RoomCreateFeatures
Builds and returns a RoomCreateFeatures object from the provided features.
buildProtoMessageFromArray()  : T
Builds a Protobuf message object from a user-provided array.

Properties

Methods

__construct()

public __construct(array<string|int, mixed> $roomMetadata) : mixed
Parameters
$roomMetadata : array<string|int, mixed>

An associative array of room metadata. The keys of the array should correspond to the properties of the RoomCreateFeatures object.

build()

Builds and returns a RoomCreateFeatures object from the provided features.

public build() : RoomCreateFeatures
Tags
throws
Exception

If the Protobuf class is not found or if there is an error setting a field.

Return values
RoomCreateFeatures

The fully constructed RoomCreateFeatures object.

buildProtoMessageFromArray()

Builds a Protobuf message object from a user-provided array.

private buildProtoMessageFromArray(array<string|int, mixed> $data, T> $protoClassFqn) : T

This method recursively builds nested message structures. It leverages the Protobuf message's setters to handle type conversions, ensuring that values are cast to the correct type as defined in the .proto file. It also correctly omits optional string fields that are empty.

Parameters
$data : array<string|int, mixed>

The input array with snake_case keys.

$protoClassFqn : T>

The fully qualified class name of the Protobuf message.

Tags
template
throws
Exception
Return values
T

The populated Protobuf message object.


        
On this page

Search results