public function claimUsedFields(array $fieldNames, $objectContainer, array $options=[]) {
		$options = array_merge(self::$defaults, $options);
		
		foreach ($fieldNames as $fieldName) {
			if (isset($this->usedFields[$fieldName]) === false) {
				$this->usedFields[$fieldName] = $objectContainer;
				continue;
			}
			if ($this->usedFields[$fieldName] === $objectContainer) {
				continue;
			}
			
			/**
			 * @note this is not allowed by the specification
			 */
			if ($this->usedFields[$fieldName] === Validator::OBJECT_CONTAINER_TYPE && $options['enforceTypeFieldNamespace'] === false) {
				continue;
			}
			
			throw new DuplicateException('field name "'.$fieldName.'" already in use at "data.'.$this->usedFields[$fieldName].'"');
		}
	}
public function claimUsedFields(array $fieldNames, $objectContainer, array $options=[]) {
		$options = array_merge(self::$defaults, $options);
		
		foreach ($fieldNames as $fieldName) {
			if (isset($this->usedFields[$fieldName]) === false) {
				$this->usedFields[$fieldName] = $objectContainer;
				continue;
			}
			if ($this->usedFields[$fieldName] === $objectContainer) {
				continue;
			}
			
			/**
			 * @note this is not allowed by the specification
			 */
			if ($this->usedFields[$fieldName] === Validator::OBJECT_CONTAINER_TYPE && $options['enforceTypeFieldNamespace'] === false) {
				continue;
			}
			
			throw new DuplicateException('field name "'.$fieldName.'" already in use at "data.'.$this->usedFields[$fieldName].'"');
		}
	}
public function claimUsedFields ( array $ fieldNames , $ objectContainer , array $ options = [ ] ) { $ options = array_merge ( self :: $ defaults , $ options ) ; foreach ( $ fieldNames as $ fieldName ) { if ( isset ( $ this -> usedFields [ $ fieldName ] ) === false ) { $ this -> usedFields [ $ fieldName ] = $ objectContainer ; continue ; } if ( $ this -> usedFields [ $ fieldName ] === $ objectContainer ) { continue ; } /**
			 * @note this is not allowed by the specification
			 */ if ( $ this -> usedFields [ $ fieldName ] === Validator :: OBJECT_CONTAINER_TYPE && $ options [ 'enforceTypeFieldNamespace' ] === false ) { continue ; } throw new DuplicateException ( 'field name "' . $ fieldName . '" already in use at "data.' . $ this -> usedFields [ $ fieldName ] . '"' ) ; } }
block if already existing in another object, otherwise just overwrite

@see https://jsonapi.org/format/1.1/#document-resource-object-fields

@param  string[] $fieldName
@param  string   $objectContainer one of the Validator::OBJECT_CONTAINER_* constants
@param  array    $options         optional {@see Validator::$defaults}

@throws DuplicateException
block if already existing in another object otherwise just overwrite