Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/js/location/core/src/entity/address/
Upload File :
Current File : /var/www/homesaver/www/bitrix/js/location/core/src/entity/address/addressfieldcollection.js

import FieldCollection from '../generic/fieldcollection';
import AddressField from './addressfield';

export default class AddressFieldCollection extends FieldCollection
{
	getFieldValue(type)
	{
		let result = null;

		if(this.isFieldExists(type))
		{
			const field = this.getField(type);

			if(field)
			{
				result = field.value;
			}
		}

		return result;
	}

	setFieldValue(type, value)
	{
		this.setField(
			new AddressField({type, value})
		);

		return this;
	}
}