lithium\g11n\catalog\adapter\Code::_merge()

protected method

Merges an item into given data and removes quotation marks from the beginning and end of message strings.

Parameters

  • array $data

    Data to merge item into.

  • array $item

    Item to merge into $data.

Returns

array

The merged data.

Source

	protected function _merge(array $data, array $item) {
		$filter = function ($value) use (&$filter) {
			if (is_array($value)) {
				return array_map($filter, $value);
			}
			return substr($value, 1, -1);
		};
		$fields = ['id', 'ids', 'translated', 'context'];

		foreach ($fields as $field) {
			if (isset($item[$field])) {
				$item[$field] = $filter($item[$field]);
			}
		}
		return parent::_merge($data, $item);
	}