eZ\Publish\Core\REST\Client\Values\User\UserGroupCreateStruct::setField PHP Method

setField() public method

This method could also be implemented by a magic setter so that $fields[$fieldDefIdentifier][$language] = $value or without language $fields[$fieldDefIdentifier] = $value is an equivalent call.
public setField ( string $fieldDefIdentifier, mixed $value, string | null $language = null )
$fieldDefIdentifier string the identifier of the field definition
$value mixed Either a plain value which is understandable by the corresponding field type or an instance of a Value class provided by the field type
$language string | null If not given on a translatable field the initial language is used
    public function setField($fieldDefIdentifier, $value, $language = null)
    {
        if (null === $language && $this->contentType->getFieldDefinition($fieldDefIdentifier)->isTranslatable) {
            $language = $this->mainLanguageCode;
        }
        $this->fields[] = new Field(array('fieldDefIdentifier' => $fieldDefIdentifier, 'value' => $value, 'languageCode' => $language));
    }
UserGroupCreateStruct