lithium\g11n\catalog\adapter\Memory::write()

public method

Writes data.

Parameters

  • string $category

    A category.

  • string $locale

    A locale identifier.

  • string $scope

    The scope for the current operation.

  • array $data

    The data to write.

Returns

boolean

Source

	public function write($category, $locale, $scope, array $data) {
		$scope = $scope ?: 'default';

		if (!isset($this->_data[$scope][$category][$locale])) {
			$this->_data[$scope][$category][$locale] = [];
		}
		foreach ($data as $item) {
			$this->_data[$scope][$category][$locale] = $this->_merge(
				$this->_data[$scope][$category][$locale],
				$this->_prepareForWrite($item)
			);
		}
		return true;
	}