PHP Class lithium\g11n\catalog\Adapter

Inheritance: extends lithium\core\Object
Mostra file Open project: unionofrad/lithium Class Usage Examples

Public Methods

Method Description
read ( string $category, string $locale, string $scope ) : null Reads data.
write ( string $category, string $locale, string $scope, array $data ) : false Writes data.

Protected Methods

Method Description
_merge ( array $data, array $item ) : array Merges an item into given data.
_prepareForWrite ( array $item ) : array Prepares an item before it is being written.

Method Details

_merge() protected method

Merges an item into given data.
protected _merge ( array $data, array $item ) : array
$data array Data to merge item into.
$item array Item to merge into $data. The item must have an `'id'` key.
return array The merged data.

_prepareForWrite() protected method

Override this method in sublcasses if you need to i.e. escape the item's values.
protected _prepareForWrite ( array $item ) : array
$item array
return array

read() public method

Override this method in subclasses if you want the adapter to have read support. The method is expected to return null if the passed category is not supported.
public read ( string $category, string $locale, string $scope ) : null
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
return null This currently does nothing.

write() public method

Override this method in subclasses if you want the adapter to have write support. The method is expected to return false if the passed category is not supported. Please note that existing data is silently overwritten.
public write ( string $category, string $locale, string $scope, array $data ) : false
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
$data array The data to write.
return false This currently does nothing.