original_string: public function setCustomFieldValue($field_name, $value, $editor = null, $required = null)
      {
          $custom_fields = isset($this->custom_fields) ? json_decode($this->custom_fields) : array();
          $custom_fields[] = array(
              'name'     => $field_name,
              'value'    => $value,
              'editor'   => $editor,
              'required'   => $required
          );
          $this->custom_fields = json_encode($custom_fields);
          return $this;
      }
code: public function setCustomFieldValue($field_name, $value, $editor = null, $required = null)
      {
          $custom_fields = isset($this->custom_fields) ? json_decode($this->custom_fields) : array();
          $custom_fields[] = array(
              'name'     => $field_name,
              'value'    => $value,
              'editor'   => $editor,
              'required'   => $required
          );
          $this->custom_fields = json_encode($custom_fields);
          return $this;
      }
code_tokens: public function setCustomFieldValue ( $ field_name , $ value , $ editor = null , $ required = null ) { $ custom_fields = isset ( $ this -> custom_fields ) ? json_decode ( $ this -> custom_fields ) : array ( ) ; $ custom_fields [ ] = array ( 'name' => $ field_name , 'value' => $ value , 'editor' => $ editor , 'required' => $ required ) ; $ this -> custom_fields = json_encode ( $ custom_fields ) ; return $ this ; }
docstring: Set the value for a custom field with the given field name
  and optionally define a Role allowed to edit it and if the field is required to be filled
  
  @param  string $field_name field name to be filled in
  @param  string $value
  @param  string $editor
  @param  string $required
  @return SignatureRequest
docstring_tokens: Set the value for a custom field with the given field name and optionally define a Role allowed to edit it and if the field is required to be filled