src/Transaction/CustomFieldTransaction.php
public function setRawCustomField($customFieldKey, $customFieldValue = null)
    {
        $customFields = $this->getCustomFields();
        if (empty($customFields)) {
            $customFields = new CustomFieldCollection();
        }

        $it = $customFields->getIterator();
        foreach ($it as $index => $existingField) {
            if ($existingField->getName() === $customFieldKey) {
                $it->offsetUnset($index);
            }
        }

        $customFields->add(new CustomField($customFieldKey, $customFieldValue, self::RAW_PREFIX));
        $this->setCustomFields($customFields);
    }
public function setRawCustomField($customFieldKey, $customFieldValue = null)
    {
        $customFields = $this->getCustomFields();
        if (empty($customFields)) {
            $customFields = new CustomFieldCollection();
        }

        $it = $customFields->getIterator();
        foreach ($it as $index => $existingField) {
            if ($existingField->getName() === $customFieldKey) {
                $it->offsetUnset($index);
            }
        }

        $customFields->add(new CustomField($customFieldKey, $customFieldValue, self::RAW_PREFIX));
        $this->setCustomFields($customFields);
    }
public function setRawCustomField ( $ customFieldKey , $ customFieldValue = null ) { $ customFields = $ this -> getCustomFields ( ) ; if ( empty ( $ customFields ) ) { $ customFields = new CustomFieldCollection ( ) ; } $ it = $ customFields -> getIterator ( ) ; foreach ( $ it as $ index => $ existingField ) { if ( $ existingField -> getName ( ) === $ customFieldKey ) { $ it -> offsetUnset ( $ index ) ; } } $ customFields -> add ( new CustomField ( $ customFieldKey , $ customFieldValue , self :: RAW_PREFIX ) ) ; $ this -> setCustomFields ( $ customFields ) ; }
Add a custom field without default prefix to the customfields

If a custom field with $customFieldKey exists, it will be overridden.

@param string $customFieldKey
@param string|null $customFieldValue
Add a custom field without default prefix to the customfields