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
420307
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);
    }
143315
private function setPropertyValue($entity, $propertyPath, $value)
    {
        if (!$this->propertyAccessor->isWritable($entity, $propertyPath)) {
            throw new CustomObjectException(
                sprintf('Property "%s::$%s" is not writable.', ClassUtils::getClass($entity), $propertyPath)
            );
        }

        $this->propertyAccessor->setValue($entity, $propertyPath, $value);
    }
315291
private function fieldToProperty($fieldValue, AbstractField $annotation)
    {
        $fieldType = $annotation->type;

        switch ($fieldType) {
            case 'string':
                $propertyValue = strval($fieldValue);
                break;
            case 'bool':
                $propertyValue = boolval($fieldValue);
                break;
            case 'int':
                $propertyValue = intval($fieldValue);
                break;
            case 'float':
                $propertyValue = floatval($fieldValue);
                break;
            case 'array':
                $propertyValue = is_array($fieldValue) ? $fieldValue : (array)($fieldValue);
                break;
            case 'date':
                /** @var \DateTime $fieldValue */
                $propertyValue = ($fieldValue instanceof \DateTime) ? new UTCDateTime($fieldValue) : $fieldValue;
                break;
            case 'id':
                $propertyValue = $fieldValue instanceof ObjectId ? $fieldValue : new ObjectId();
                break;
            case 'embedOne':
                $propertyValue = $this->embedOneToProperty($fieldValue, $annotation);
                break;
            case 'embedMany':
                $propertyValue = $this->embedManyToProperty((array)$fieldValue, $annotation);
                break;
            case 'raw':
            default:
                $propertyValue = $fieldValue;
                break;
        }

        return $propertyValue;
    }
61745
public function hasCustomField($key)
    {
        if($key !== 'customFields' && !array_key_exists($key, $this->getAttributes())) {
            if(isset($this->customFields->$key)) {
                return true;
            }
        }
        return false;
    }
20004
public CustomField getCustomField(FieldType field)
   {
      CustomField result = m_configMap.get(field);
      if (result == null)
      {
         result = new CustomField(field, this);
         m_configMap.put(field, result);
      }
      return result;
   }
639714
def add_custom_fields(cls, *args, **kw):
        
        for factory in config.custom_field_factories:
            for field in factory():
                setattr(cls, field.name, field)
717117
private function addValue($field, $value, $arrayKey)
    {
        $name = ':'. $arrayKey . $field;

        $this->names[$arrayKey][$field]      = $name;
        $this->parameters[$arrayKey][$field] = $value;
    }
693581
public CustomFields createCustomField(String accountId, CustomField customField) throws ApiException {
    return createCustomField(accountId, customField, null);
  }
1243853
public function createField($fieldName, $defaultValue = null)
    {
        $fieldType = $this->fieldType;
        $field = $fieldType::create($fieldName, $this->Title, $defaultValue);
        $field->addExtraClass($this->ExtraClass);
        $this->extend('updateCreateField', $field);
        return $field;
    }
882769
public BranchEvent addCustomDataProperty(String propertyName, String propertyValue) {
        try {
            this.customProperties.put(propertyName, propertyValue);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return this;
    }
1303621
function CustomField(obj){
    this._id = obj && obj.id;
    this._field = obj && obj.field;
    this._value = obj && obj.value;
}
805237
public function customDictionariesEdit($customDictionary)
    {
        if (!count($customDictionary) ||
            empty($customDictionary['code']) ||
            empty($customDictionary['elements'])
        ) {
            throw new \InvalidArgumentException(
                'Parameter `dictionary` must contain a data & fields `code` & `elemets` must be set'
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            "/custom-fields/dictionaries/{$customDictionary['code']}/edit",
            "POST",
            ['customDictionary' => json_encode($customDictionary)]
        );
    }
603220
public function setFieldParam(string $field, string $key, string $value): self
    {
        if (!isset($this->_params[$field])) {
            $this->_params[$field] = [];
        }

        $this->_params[$field][$key] = $value;

        return $this;
    }
853011
public function field($fieldName, $fieldValue = '', $fieldBoost = null) {
        if(empty($fieldName)) {
            throw new \InvalidArgumentException('Please provide a fieldname');
        }
        $field = array(
			'name'=> $fieldName,
			'value' => $fieldValue
        );
        if(!empty($fieldBoost)) {
            $field['boost'] = $fieldBoost;
        }
        $this->fields[] = $field;
        return $this;
    }
182462
public void addValueToField(String fieldName, Object value) {
		add(new SimpleUpdateField(fieldName, value, UpdateAction.ADD));
	}
822776
public CreateIssueParams singleListCustomFieldMap(Map<Long, Long> customFieldMap) {
        Set<Long> keySet = customFieldMap.keySet();
        for (Long key : keySet) {
            parameters.add(new NameValuePair("customField_" + key.toString(), customFieldMap.get(key).toString()));
        }
        return this;
    }
940292
protected function addAnyCustomFieldIdQueryResult($customFieldId, $firstRootAlias, $qb)
    {
        $qbCloned = clone $qb;
        if (!in_array('cf', $qb->getAllAliases())) {
            $qbCloned->join($firstRootAlias . '.customFields', 'cf');
        }
        $qbCloned->andWhere('cf.fieldId = :fieldId')
            ->setParameter('fieldId', $customFieldId);

        return $qbCloned->getQuery()->getResult();
    }